Opt to not use a map for meta. Use individual prefixed keys instead. Also translate them.

Not using a map will decrease the risk of an entry containing more than 255 chars (limit)
Fix some stuff for magic
This commit is contained in:
Matthew Messinger 2016-05-21 23:56:50 -04:00
parent c4346e4812
commit 4fb4a63f65
18 changed files with 118 additions and 79 deletions

View file

@ -18,7 +18,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
@ -28,8 +27,6 @@ import com.mojang.authlib.properties.Property;
import com.mojang.util.UUIDTypeAdapter;
import com.mumfrey.liteloader.core.LiteLoader;
import com.mumfrey.liteloader.util.log.LiteLoaderLogger;
import com.mumfrey.webprefs.WebPreferencesManager;
import com.mumfrey.webprefs.interfaces.IWebPreferences;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
@ -54,8 +51,6 @@ public final class HDSkinManager {
private Map<UUID, Map<Type, ResourceLocation>> skinCache = Maps.newHashMap();
private List<ISkinModifier> skinModifiers = Lists.newArrayList();
private WebPreferencesManager webprefs = WebPreferencesManager.getDefault();
private HDSkinManager() {}
public Optional<ResourceLocation> getSkinLocation(GameProfile profile1, Type type, boolean loadIfAbsent) {
@ -141,16 +136,13 @@ public final class HDSkinManager {
Map<Type, MinecraftProfileTexture> textures = this.profileTextures.get(profile.getId());
if (textures == null) {
IWebPreferences prefs = this.webprefs.getPreferences(profile);
TypeToken<?> map = new TypeToken<Map<String, String>>() {};
Map<String, String> metadata = new Gson().fromJson(prefs.get(METADATA_KEY), map.getType());
String uuid = UUIDTypeAdapter.fromUUID(profile.getId());
String skinUrl = getCustomTextureURLForId(Type.SKIN, uuid, false);
String capeUrl = getCustomTextureURLForId(Type.CAPE, uuid);
String elytraUrl = getCustomTextureURLForId(Type.ELYTRA, uuid);
textures = ImmutableMap.of(
Type.SKIN, new MinecraftProfileTexture(skinUrl, metadata),
Type.SKIN, new MinecraftProfileTexture(skinUrl, null),
Type.CAPE, new MinecraftProfileTexture(capeUrl, null),
Type.ELYTRA, new MinecraftProfileTexture(elytraUrl, null));
this.profileTextures.put(profile.getId(), textures);

View file

@ -13,13 +13,13 @@ import org.lwjgl.input.Keyboard;
import com.google.common.base.Converter;
import com.google.common.base.Enums;
import com.google.common.base.Functions;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.primitives.Ints;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mumfrey.liteloader.client.gui.GuiCheckbox;
import com.mumfrey.webprefs.WebPreferencesManager;
import com.mumfrey.webprefs.interfaces.IWebPreferences;
@ -224,18 +224,28 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
}
public void push() {
String data = new Gson().toJson(toMap());
IWebPreferences prefs = WebPreferencesManager.getDefault().getLocalPreferences(false);
prefs.set(HDSkinManager.METADATA_KEY, data);
Map<String, String> data = this.toMap();
for (Entry<String, String> e : data.entrySet()) {
prefs.set(e.getKey(), e.getValue());
}
// set the enabled metadata
prefs.set(HDSkinManager.METADATA_KEY, Joiner.on(',').join(data.keySet()));
prefs.commit(false);
}
public void fetch() {
IWebPreferences prefs = WebPreferencesManager.getDefault().getLocalPreferences(false);
String json = prefs.get(HDSkinManager.METADATA_KEY, "{}");
Map<String, String> data = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
fromMap(data);
if (prefs.has(HDSkinManager.METADATA_KEY)) {
String meta = prefs.get(HDSkinManager.METADATA_KEY);
Map<String, String> data = Maps.newHashMap();
for (String key : Splitter.on(',').split(meta)) {
if (prefs.has(key)) {
data.put(key, prefs.get(key));
}
}
fromMap(data);
}
}
private Map<String, String> toMap() {
@ -249,13 +259,10 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
}
private void fromMap(Map<String, String> data) {
for (Entry<String, String> e : data.entrySet()) {
for (Opt<?> opt : options) {
if (opt.name.equals(e.getKey())) {
opt.fromString(e.getValue());
opt.setEnabled(opt.value.isPresent());
break;
}
for (Opt<?> opt : options) {
if (data.containsKey(opt.getName())) {
opt.fromString(data.get(opt.getName()));
opt.setEnabled(opt.value.isPresent());
}
}
}
@ -386,7 +393,7 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
@Override
public void init() {
super.init();
this.guiSlider = new GuiSlider(this, 0, optionPosX + 20, optionHeight, this.name, min, max, min, this);
this.guiSlider = new GuiSlider(this, 0, optionPosX + 20, optionHeight, I18n.format(this.name), min, max, min, this);
optionHeight += 22;
}
@ -460,7 +467,7 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
@Override
protected void init() {
super.init();
this.button = new GuiButton(0, optionPosX + 20, optionHeight, 100, 20, name + ": " + I18n.format(this.get().toString()));
this.button = new GuiButton(0, optionPosX + 20, optionHeight, 100, 20, I18n.format(name, this.get().toString()));
optionHeight += 22;
}
@ -479,7 +486,7 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
this.index = 0;
}
this.value = Optional.of(get());
this.button.displayString = name + ": " + I18n.format(this.toString());
this.button.displayString = I18n.format(name, this.toString());
}
}
@ -496,7 +503,7 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
public void fromString(String s) {
value = Enums.getIfPresent(type, s);
this.index = value.isPresent() ? value.get().ordinal() : 0;
this.button.displayString = name + ": " + I18n.format(this.toString());
this.button.displayString = I18n.format(name, this.toString());
}
}
@ -525,7 +532,7 @@ public class GuiMetaHandler extends GuiScreen implements IMetaHandler {
@Override
protected void init() {
super.init();
this.color = new GuiColorButton(mc, 0, optionPosX + 20, optionHeight, 20, 20, value.get(), name, this);
this.color = new GuiColorButton(mc, 0, optionPosX + 20, optionHeight, 20, 20, value.get(), I18n.format(name), this);
}
@Override

View file

@ -230,7 +230,7 @@ public class GuiSkins extends GuiScreen implements IUploadCompleteCallback, IOpe
}
protected void setupMetaOverrides(GuiMetaHandler meta) {
meta.bool("slim");
meta.bool("hdskins.slim");
}
/**

View file

@ -18,3 +18,5 @@ hdskins.local=Local Skin
hdskins.server=Server Skin
gui.ok=OK
hdskins.slim=Slim arms

View file

@ -29,6 +29,12 @@ public class MineLittlePony {
public static final String MOD_NAME = "Mine Little Pony";
public static final String MOD_VERSION = "@VERSION@";
public static final String MLP_SIZE = "mlp.size";
public static final String MLP_GENDER = "mlp.gender";
public static final String MLP_TAIL = "mlp.tail";
public static final String MLP_RACE = "mlp.race";
public static final String MLP_MAGIC = "mlp.magic";
private static final String SKIN_SERVER_URL = "minelpskins.voxelmodpack.com";
private static final String GATEWAY_URL = "minelpskinmanager.voxelmodpack.com";
private static final KeyBinding SETTINGS_GUI = new KeyBinding("Settings", Keyboard.KEY_F9, "Mine Little Pony");

View file

@ -2,7 +2,7 @@ package com.brohoof.minelittlepony;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Map;
import java.util.List;
import javax.imageio.ImageIO;
@ -10,8 +10,10 @@ import com.brohoof.minelittlepony.model.PMAPI;
import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.util.MineLPLogger;
import com.brohoof.minelittlepony.util.PonyFields;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import com.mumfrey.webprefs.WebPreferencesManager;
import com.mumfrey.webprefs.interfaces.IWebPreferences;
@ -72,27 +74,46 @@ public class Pony {
}
private void checkMeta(GameProfile profile) {
IWebPreferences prefs = WebPreferencesManager.getDefault().getPreferences(profile);
final IWebPreferences prefs = WebPreferencesManager.getDefault().getPreferences(profile);
if (prefs == null)
return;
String json = prefs.get(HDSkinManager.METADATA_KEY, "{}");
Map<String, String> data = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
final List<String> keys;
if (prefs.has(HDSkinManager.METADATA_KEY)) {
String list = prefs.get(HDSkinManager.METADATA_KEY);
keys = Splitter.on(',').splitToList(list);
} else {
keys = Lists.newArrayList();
}
if (data == null)
return;
// >inb4 java 8
// checkMeta(Predicates.and(keys::contains, prefs::has), prefs::get);
checkMeta(new Predicate<String>() {
@Override
public boolean apply(String key) {
return keys.contains(key) && prefs.has(key);
}
}, new Function<String, String>() {
@Override
public String apply(String key) {
return prefs.get(key);
}
});
}
if (data.containsKey("race"))
metadata.setRace(PonyRace.valueOf(data.get("race")));
if (data.containsKey("tail"))
metadata.setTail(TailLengths.valueOf(data.get("tail")));
if (data.containsKey("gender"))
metadata.setGender(PonyGender.valueOf(data.get("gender")));
if (data.containsKey("size"))
metadata.setSize(PonySize.valueOf(data.get("size")));
if (data.containsKey("magic"))
metadata.setGlowColor(Integer.parseInt(data.get("magic")));
private void checkMeta(Predicate<String> has, Function<String, String> prefs) {
if (has.apply(MineLittlePony.MLP_RACE))
metadata.setRace(PonyRace.valueOf(prefs.apply(MineLittlePony.MLP_RACE)));
if (has.apply(MineLittlePony.MLP_TAIL))
metadata.setTail(TailLengths.valueOf(prefs.apply(MineLittlePony.MLP_TAIL)));
if (has.apply(MineLittlePony.MLP_GENDER))
metadata.setGender(PonyGender.valueOf(prefs.apply(MineLittlePony.MLP_GENDER)));
if (has.apply(MineLittlePony.MLP_SIZE))
metadata.setSize(PonySize.valueOf(prefs.apply(MineLittlePony.MLP_SIZE)));
if (has.apply(MineLittlePony.MLP_MAGIC))
metadata.setGlowColor(Integer.parseInt(prefs.apply(MineLittlePony.MLP_MAGIC)));
}
public BufferedImage getBufferedImage(ResourceLocation textureResourceLocation) {

View file

@ -72,8 +72,12 @@ public class PonyData {
return glowColor;
}
public boolean hasMagic() {
return this.race != null && this.race.hasHorn() && this.glowColor != 0;
}
public void setGlowColor(int glowColor) {
this.glowColor = glowColor;
this.glowColor = glowColor & 0xffffff;
}
public int getTextureWidth() {

View file

@ -2,6 +2,7 @@ package com.brohoof.minelittlepony.hdskins.gui;
import java.awt.image.BufferedImage;
import com.brohoof.minelittlepony.MineLittlePony;
import com.brohoof.minelittlepony.PonyGender;
import com.brohoof.minelittlepony.PonyManager;
import com.brohoof.minelittlepony.PonyRace;
@ -24,11 +25,11 @@ public class GuiSkinsMineLP extends GuiSkins {
@Override
protected void setupMetaOverrides(GuiMetaHandler meta) {
super.setupMetaOverrides(meta);
meta.selection("race", PonyRace.class);
meta.selection("tail", TailLengths.class);
meta.selection("gender", PonyGender.class);
meta.selection("size", PonySize.class);
meta.color("magic");
meta.selection(MineLittlePony.MLP_RACE, PonyRace.class);
meta.selection(MineLittlePony.MLP_TAIL, TailLengths.class);
meta.selection(MineLittlePony.MLP_GENDER, PonyGender.class);
meta.selection(MineLittlePony.MLP_SIZE, PonySize.class);
meta.color(MineLittlePony.MLP_MAGIC);
}
@Override

View file

@ -26,11 +26,11 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
thePony.checkSkin();
if (playermodel.metaHandler != null) {
Optional<String> race = playermodel.metaHandler.get("race");
Optional<String> tail = playermodel.metaHandler.get("tail");
Optional<String> gender = playermodel.metaHandler.get("gender");
Optional<String> size = playermodel.metaHandler.get("size");
Optional<String> magicColor = playermodel.metaHandler.get("magic");
Optional<String> race = playermodel.metaHandler.get(MineLittlePony.MLP_RACE);
Optional<String> tail = playermodel.metaHandler.get(MineLittlePony.MLP_TAIL);
Optional<String> gender = playermodel.metaHandler.get(MineLittlePony.MLP_GENDER);
Optional<String> size = playermodel.metaHandler.get(MineLittlePony.MLP_SIZE);
Optional<String> magicColor = playermodel.metaHandler.get(MineLittlePony.MLP_MAGIC);
if (race.isPresent())
thePony.metadata.setRace(PonyRace.valueOf(race.get()));

View file

@ -100,7 +100,7 @@ public class PegasusWings implements IPonyPart, PonyModelConstants {
public void animate(PonyData metadata, float move, float swing, float tick, float horz, float vert) {
float bodySwingRotation = 0.0F;
if (pony.swingProgress > -9990.0F && (!metadata.getRace().hasHorn() || metadata.getGlowColor() == 0)) {
if (pony.swingProgress > -9990.0F && !metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(pony.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
for (int i = 0; i < this.leftWing.length; ++i) {

View file

@ -42,22 +42,22 @@ public class UnicornHorn extends AbstractHeadPart implements PonyModelConstants
super.render(data, scale);
if (data.getRace() != null && data.getRace().hasHorn()) {
this.horn.render(scale);
if ((pony.leftArmPose != ArmPose.EMPTY || pony.rightArmPose != ArmPose.EMPTY) && data.getGlowColor() != 0) {
if ((pony.leftArmPose != ArmPose.EMPTY || pony.rightArmPose != ArmPose.EMPTY) && data.hasMagic()) {
GL11.glPushAttrib(24577);
disableTexture2D();
disableLighting();
enableBlend();
float var4 = (data.getGlowColor() >> 16 & 255) / 255.0F;
float red = (data.getGlowColor() >> 16 & 255) / 255.0F;
float green = (data.getGlowColor() >> 8 & 255) / 255.0F;
float blue = (data.getGlowColor() & 255) / 255.0F;
blendFunc(GL11.GL_SRC_ALPHA, 1);
this.horn.postRender(scale);
color(var4, green, blue, 0.4F);
color(red, green, blue, 0.4F);
this.hornglow[0].render(scale);
color(var4, green, blue, 0.2F);
color(red, green, blue, 0.2F);
this.hornglow[1].render(scale);
enableTexture2D();

View file

@ -50,7 +50,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.rotateHead(horz, vert);
this.swingTailZ(move, swing);
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) {
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
@ -328,7 +328,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
@SuppressWarnings("incomplete-switch")
protected void holdItem() {
if (!this.rainboom && (!this.metadata.getRace().hasHorn() && this.metadata.getGlowColor() != 0)) {
if (!this.rainboom && !this.metadata.hasMagic()) {
switch (this.leftArmPose) {
case EMPTY:
@ -370,7 +370,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
EnumHandSide mainSide = this.getMainHand(entity);
boolean mainRight = mainSide == EnumHandSide.RIGHT;
ArmPose mainPose = mainRight ? this.rightArmPose : this.leftArmPose;
if (this.metadata.getRace().hasHorn() && this.metadata.getGlowColor() != 0 && mainPose != ArmPose.EMPTY) {
if (this.metadata.hasMagic() && mainPose != ArmPose.EMPTY) {
ModelRenderer unicornarm = mainSide == EnumHandSide.LEFT ? this.unicornArmLeft : this.unicornArmRight;
@ -396,7 +396,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
if (this.rightArmPose != ArmPose.EMPTY && !this.isSleeping) {
float cosTickFactor = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
float sinTickFactor = MathHelper.sin(tick * 0.067F) * 0.05F;
if (this.metadata.getRace().hasHorn() && this.metadata.getGlowColor() != 0) {
if (this.metadata.hasMagic()) {
this.unicornArmRight.rotateAngleZ += cosTickFactor;
this.unicornArmRight.rotateAngleX += sinTickFactor;
} else {
@ -409,7 +409,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
if (this.leftArmPose != ArmPose.EMPTY && !this.isSleeping) {
float cosTickFactor = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
float sinTickFactor = MathHelper.sin(tick * 0.067F) * 0.05F;
if (this.metadata.getRace().hasHorn() && this.metadata.getGlowColor() != 0) {
if (this.metadata.hasMagic()) {
this.unicornArmLeft.rotateAngleZ += cosTickFactor;
this.unicornArmLeft.rotateAngleX += sinTickFactor;
} else {
@ -504,7 +504,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
protected void aimBow(ArmPose leftArm, ArmPose rightArm, float tick) {
if (leftArm == ArmPose.BOW_AND_ARROW || rightArm == ArmPose.BOW_AND_ARROW) {
if (this.metadata.getRace().hasHorn() && this.metadata.getGlowColor() != 0) {
if (this.metadata.hasMagic()) {
this.aimBowUnicorn(tick);
} else {
this.aimBowPony(leftArm, rightArm, tick);

View file

@ -69,7 +69,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
if (this.rightArmPose != ArmPose.EMPTY) {
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
if (this.metadata.getGlowColor() == 0) {
if (!this.metadata.hasMagic()) {
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
this.bipedRightArm.rotateAngleX = -1.5707964F;
@ -91,7 +91,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
if (this.leftArmPose != ArmPose.EMPTY) {
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
if (this.metadata.getGlowColor() == 0) {
if (!this.metadata.hasMagic()) {
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F;
this.bipedLeftArm.rotateAngleX = -1.5707964F;
@ -115,7 +115,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
@Override
protected void fixSpecialRotationPoints(float move) {
if (this.rightArmPose != ArmPose.EMPTY && this.metadata.getGlowColor() == 0) {
if (this.rightArmPose != ArmPose.EMPTY && !this.metadata.hasMagic()) {
setRotationPoint(this.bipedRightArm, -1.5F, 9.5F, 4.0F);
}

View file

@ -21,7 +21,7 @@ public class ModelVillagerPony extends ModelPlayerPony {
public void animate(float move, float swing, float tick, float horz, float vert, Entity entity) {
super.animate(move, swing, tick, horz, vert, entity);
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) {
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
for (int i = 0; i < this.VillagerBagPiece.length; ++i) {

View file

@ -29,7 +29,7 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.checkRainboom(entity, swing);
this.rotateHead(horz, vert);
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) {
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}

View file

@ -63,7 +63,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor {
if (this.rightArmPose != ArmPose.EMPTY) {
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
if (this.metadata.getGlowColor() == 0) {
if (!this.metadata.hasMagic()) {
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
this.bipedRightArm.rotateAngleX = -1.5707964F;
@ -85,7 +85,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor {
@Override
protected void fixSpecialRotationPoints(float move) {
if (this.rightArmPose != ArmPose.EMPTY && this.metadata.getGlowColor() == 0) {
if (this.rightArmPose != ArmPose.EMPTY && !this.metadata.hasMagic()) {
setRotationPoint(this.bipedRightArm, -1.5F, 9.5F, 4.0F);
}

View file

@ -73,7 +73,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
GlStateManager.pushMatrix();
AbstractPonyModel thePony = ((IRenderPony) this.livingPonyEntity).getPony().getModel();
PonyData metadata = thePony.metadata;
boolean isUnicorn = metadata.getRace().hasHorn();
boolean isUnicorn = metadata.hasMagic();
if (isUnicorn) {
ModelPlayerPony playerModel = (ModelPlayerPony) thePony;
ModelRenderer unicornarm = hand == EnumHandSide.LEFT ? playerModel.unicornArmLeft : playerModel.unicornArmRight;
@ -95,7 +95,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
}
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity, drop, transform, isLeft);
if (isUnicorn && metadata.getGlowColor() != 0) {
if (isUnicorn) {
this.renderItemGlow(entity, drop.copy(), transform, hand, metadata.getGlowColor());
}
GlStateManager.popMatrix();

View file

@ -16,3 +16,9 @@ minelp.mobs.villagers=Ponify villagers
minelp.mobs.zombies=Ponify zombies
minelp.mobs.zombiepigmen=Ponify zombie pigmen
minelp.mobs.skeletons=Ponify skeletons
mlp.race=Race: %s
mlp.tail=Tail: %s
mlp.gender=Gender: %s
mlp.size=Size: %s
mlp.magic=Magic color