From 45f408cf1b53bfbce56c27d80f73aa91a00cf6be Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Tue, 19 Jan 2016 00:34:07 -0500 Subject: [PATCH] Port hdskins to mixins. Other changes to HDSkinManager Allow hd skins to be toggled on demand Support small arms. --- build.gradle | 6 +- src/{main => common}/resources/litemod.json | 14 +- .../voxelmodpack/hdskins/HDPrivateFields.java | 31 --- .../voxelmodpack/hdskins/HDSkinDownload.java | 71 ----- .../voxelmodpack/hdskins/HDSkinManager.java | 243 ++++++------------ .../hdskins/HDThreadImageDownload.java | 11 + .../hdskins/ImageBufferDownloadHD.java | 2 +- .../mixin/MixinImageBufferDownload.java | 34 +++ .../hdskins/mixin/MixinPlayerInfo.java | 43 ++++ .../hdskins/mixin/MixinSkullRenderer.java | 37 +++ src/hdskins/resources/events.json | 28 -- src/hdskins/resources/mixin.hdskins.json | 9 + .../minelittlepony/MineLittlePony.java | 16 +- .../java/com/brohoof/minelittlepony/Pony.java | 10 +- .../brohoof/minelittlepony/PonyConfig.java | 2 + .../hdskins/gui/RenderPonyModel.java | 3 +- .../mixin/MixinRenderPlayer.java | 18 +- .../model/AbstractPonyModel.java | 59 ++--- .../brohoof/minelittlepony/model/PMAPI.java | 6 +- .../model/pony/ModelHumanPlayer.java | 4 + .../model/pony/ModelPlayerPony.java | 104 ++++---- .../model/pony/ModelSkeletonPony.java | 14 +- .../model/pony/ModelVillagerPony.java | 4 + .../model/pony/ModelZombiePony.java | 12 +- .../model/pony/armor/HumanArmors.java | 4 +- .../model/pony/armor/ModelPonyArmor.java | 3 +- .../pony/armor/ModelSkeletonPonyArmor.java | 8 +- .../pony/armor/ModelZombiePonyArmor.java | 8 +- .../renderer/layer/LayerHeldPonyItem.java | 3 +- .../renderer/layer/LayerPonyCape.java | 3 +- .../assets/minelittlepony/lang/en_US.lang | 2 +- .../assets/minelittlepony/lang/fr_FR.lang | 2 +- .../assets/minelittlepony/lang/ru_RU.lang | 2 +- 33 files changed, 371 insertions(+), 445 deletions(-) rename src/{main => common}/resources/litemod.json (51%) delete mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/HDPrivateFields.java delete mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/HDSkinDownload.java create mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/HDThreadImageDownload.java create mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinImageBufferDownload.java create mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinPlayerInfo.java create mode 100644 src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java delete mode 100644 src/hdskins/resources/events.json create mode 100644 src/hdskins/resources/mixin.hdskins.json diff --git a/build.gradle b/build.gradle index 5f3b6187..c7be011a 100644 --- a/build.gradle +++ b/build.gradle @@ -43,16 +43,20 @@ sourceSets { configurations.forgeGradleMc, configurations.provided ] + main { + refMap = 'mixin.minelp.refmap.json' + } common { compileClasspath += files deps } hdskins { compileClasspath += files deps + refMap = 'mixin.hdskins.refmap.json' } } project('forge') { apply plugin: 'net.minecraftforge.gradle.forge' - version = '0' + version = '0.0' minecraft { version = '1.8-11.14.3.1543' mappings = rootProject.minecraft.mappings diff --git a/src/main/resources/litemod.json b/src/common/resources/litemod.json similarity index 51% rename from src/main/resources/litemod.json rename to src/common/resources/litemod.json index 946bd556..cc0c6554 100644 --- a/src/main/resources/litemod.json +++ b/src/common/resources/litemod.json @@ -1,12 +1,12 @@ { - "name": "minelp", - "mcversion": "${mcversion}", - "version": "${version}", - "revision": "${revision}", - "author": "Verdana, Rene_Z, Mumfrey, JoyJoy", + "name": "minelp", + "mcversion": "${mcversion}", + "version": "${version}", + "revision": "${revision}", + "author": "Verdana, Rene_Z, Mumfrey, JoyJoy", "voxelCommonJarName": "voxelcommon-2.4.0.jar", - "mixinConfigs": "mixin.minelp.json", - "description": "Mine Little Pony turns players and mobs into ponies", + "mixinConfigs": [ "mixin.minelp.json", "mixin.hdskins.json" ], + "description": "Mine Little Pony turns players and mobs into ponies", "description.minelittlepony": "Mine Little Pony turns players and mobs into ponies", "description.hdskins": "Seperate skin server for Mine Little Pony that also supports HD skins. Access via Skin Manager key binding (default: F1) in the main menu." } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDPrivateFields.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDPrivateFields.java deleted file mode 100644 index bd7f368f..00000000 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDPrivateFields.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.voxelmodpack.hdskins; - -import java.util.Map; - -import com.google.common.cache.Cache; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; -import com.mumfrey.liteloader.core.runtime.Obf; -import com.mumfrey.liteloader.util.PrivateFields; - -import net.minecraft.client.resources.SkinManager; - -public class HDPrivateFields extends PrivateFields { - - public static PrivateFields>> skinCacheLoader = new HDPrivateFields>>( - SkinManager.class, HDObf.skinLoadingCache); - - protected HDPrivateFields(Class

owner, Obf obf) { - super(owner, obf); - } - - private static class HDObf extends Obf { - private static Obf skinLoadingCache = new HDObf("field_152798_f", "e", "skinCacheLoader"); - - protected HDObf(String seargeName, String obfName, String mcpName) { - super(seargeName, obfName, mcpName); - } - } - -} diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinDownload.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinDownload.java deleted file mode 100644 index e390cb35..00000000 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinDownload.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.voxelmodpack.hdskins; - -import java.awt.image.BufferedImage; -import java.net.HttpURLConnection; -import java.net.Proxy; -import java.net.URL; - -import javax.imageio.ImageIO; - -import com.mumfrey.liteloader.util.log.LiteLoaderLogger; -import com.voxelmodpack.common.runtime.PrivateFields; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.IImageBuffer; -import net.minecraft.client.renderer.ThreadDownloadImageData; - -class HDSkinDownload extends Thread { - private final ThreadDownloadImageData image; - private final IImageBuffer imageBuffer; - private final String skinUrl; - private final Thread originalThread; - - HDSkinDownload(ThreadDownloadImageData image, IImageBuffer imageBuffer, String url) { - this.image = image; - this.imageBuffer = imageBuffer != null ? imageBuffer : (IImageBuffer) PrivateFields.imageBuffer.get(image); - this.originalThread = PrivateFields.imageThread.get(image); - this.skinUrl = url; - } - - @Override - public void run() { - Proxy proxy = Minecraft.getMinecraft().getProxy(); - if (!this.tryDownload(proxy, this.skinUrl) && this.originalThread != null) { - PrivateFields.imageBuffer.set(image, imageBuffer); - this.originalThread.run(); - } - - } - - boolean tryDownload(Proxy proxy, String strUrl) { - HttpURLConnection httpConnection = null; - - try { - LiteLoaderLogger.debug("Downloading HD Skin from %s", strUrl); - URL ex = new URL(strUrl); - httpConnection = (HttpURLConnection) ex.openConnection(proxy); - httpConnection.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); - httpConnection.setDoInput(true); - httpConnection.setDoOutput(false); - httpConnection.connect(); - if (httpConnection.getResponseCode() / 100 == 2) { - BufferedImage image1 = ImageIO.read(httpConnection.getInputStream()); - if (this.imageBuffer != null) { - image1 = this.imageBuffer.parseUserSkin(image1); - } - - this.image.setBufferedImage(image1); - return true; - } - } catch (Exception var10) { - return false; - } finally { - if (httpConnection != null) { - httpConnection.disconnect(); - } - - } - - return false; - } -} diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index 7ce75b20..d2afaa6b 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -4,16 +4,12 @@ import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.UUID; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import com.google.common.cache.Cache; +import com.google.common.base.Optional; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.mojang.authlib.GameProfile; @@ -21,158 +17,89 @@ import com.mojang.authlib.minecraft.InsecureTextureException; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.util.UUIDTypeAdapter; import com.mumfrey.liteloader.core.LiteLoader; -import com.mumfrey.liteloader.transformers.event.EventInfo; import com.mumfrey.liteloader.util.log.LiteLoaderLogger; -import com.voxelmodpack.common.runtime.PrivateFields; import net.minecraft.client.Minecraft; -import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.IImageBuffer; import net.minecraft.client.renderer.ThreadDownloadImageData; import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.resources.DefaultPlayerSkin; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.client.resources.SkinManager.SkinAvailableCallback; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StringUtils; -import net.minecraft.world.World; public final class HDSkinManager { - private static String gatewayUrl = "skinmanager.voxelmodpack.com"; - private static String skinUrl = "skins.voxelmodpack.com"; - private static Cache> skinsCache; - private static final Map playerHashes = Maps.newHashMap(); - private static final Map> cachedTextures = Maps.newHashMap(); - private static List skinModifiers = Lists.newArrayList(); + public static final HDSkinManager INSTANCE = new HDSkinManager(); + private static final ResourceLocation LOADING = new ResourceLocation("LOADING"); + private static final File skinCacheDir = new File("assets/skins"); - public static void onDownloadSkin(EventInfo e) { - ThreadDownloadImageData imageDownload = e.getSource(); - if (imageDownload != null) { - String imageUrl = PrivateFields.imageUrl.get(imageDownload); - if (imageUrl != null) { - if (imageUrl.contains("optifine.net")) - return; // ignore optifine capes - String hash = FilenameUtils.getBaseName(imageUrl); - String uuid = resolvePlayerIdFromHash(hash); - if (uuid == null) { - if (!(imageDownload instanceof PreviewTexture)) { - return; - } + private String gatewayUrl = "skinmanager.voxelmodpack.com"; + private String skinUrl = "skins.voxelmodpack.com"; + private boolean enabled = true; - uuid = Minecraft.getMinecraft().getSession().getPlayerID(); + private Map skinCache = Maps.newHashMap(); + private List skinModifiers = Lists.newArrayList(); + + private HDSkinManager() {} + + public static Optional getSkin(final GameProfile profile) { + return INSTANCE.getSkinLocation(profile); + } + + private Optional getSkinLocation(final GameProfile profile) { + if (!enabled) + return Optional.absent(); + ResourceLocation skin = skinCache.get(profile); + if (skin == null) { + skinCache.put(profile, LOADING); + loadTexture(profile, Type.SKIN, new SkinAvailableCallback() { + @Override + public void skinAvailable(Type p_180521_1_, ResourceLocation location, MinecraftProfileTexture profileTexture) { + skinCache.put(profile, location); } - - Map textures = getCachedTexturesForId(uuid); - MinecraftProfileTexture skinTexture = textures.get(Type.SKIN); - if (skinTexture != null && skinTexture.getUrl().equals(imageUrl)) { - Thread imageThread = PrivateFields.imageThread.get(imageDownload); - if (imageThread != null) { - HDSkinDownload hdThread = new HDSkinDownload(imageDownload, new ImageBufferDownloadHD(), - getCustomSkinURLForId(uuid, imageDownload instanceof PreviewTexture)); - PrivateFields.imageThread.set(imageDownload, hdThread); - hdThread.setDaemon(true); - hdThread.start(); - e.cancel(); - } - } else { - LiteLoaderLogger.debug("Not a skin texture!"); - } - } + }); + return Optional.absent(); } + return skin == LOADING ? Optional. absent() : Optional.of(skin); } - private static String resolvePlayerIdFromHash(String hash) { - Minecraft mc = Minecraft.getMinecraft(); - if (mc.theWorld == null) { - return null; - } - return findPlayer(mc, hash); + private void loadTexture(GameProfile profile, final Type type, final SkinAvailableCallback callback) { + if (profile != null && profile.getId() != null) { + String uuid = UUIDTypeAdapter.fromUUID(profile.getId()); + String url = getCustomSkinURLForId(uuid, true); + // TODO use cache + final MinecraftProfileTexture texture = new MinecraftProfileTexture(url, null); + final ResourceLocation skin = new ResourceLocation("skins/" + texture.getHash()); + File file1 = new File(skinCacheDir, texture.getHash().substring(0, 2)); + @SuppressWarnings("unused") + File file2 = new File(file1, texture.getHash()); + final IImageBuffer imagebufferdownload = new ImageBufferDownloadHD(); + ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(null, url, + DefaultPlayerSkin.getDefaultSkinLegacy(), + new IImageBuffer() { + public BufferedImage parseUserSkin(BufferedImage image) { + return imagebufferdownload.parseUserSkin(image); + } - } + public void skinAvailable() { + imagebufferdownload.skinAvailable(); + if (callback != null) { + callback.skinAvailable(type, skin, texture); + } + } + }); - private static String findPlayer(Minecraft mc, String hash) { - String uuid = findNetworkPlayer(mc, hash); - if (uuid == null) { - uuid = findWorldPlayers(mc.theWorld, hash); - } - if (uuid == null) { - uuid = findSkullPlayers(hash); - } - return uuid; - } - - private static String findNetworkPlayer(Minecraft mc, String hash) { - Collection playersInfo = mc.getNetHandler().getPlayerInfoMap(); - // players - for (NetworkPlayerInfo player : playersInfo) { - GameProfile profile = player.getGameProfile(); - Map textures = getTexturesForProfile(profile); - storeTexturesForProfile(profile, textures); - String uuid = findUUID(profile, textures, hash); - if (uuid != null) - return uuid; - } - return null; - } - - private static String findWorldPlayers(World world, String hash) { - @SuppressWarnings("unchecked") - List players = world.playerEntities; - for (EntityPlayer player : players) { - GameProfile profile = player.getGameProfile(); - Map textures = getTexturesForProfile(profile); - storeTexturesForProfile(profile, textures); - String uuid = findUUID(profile, textures, hash); - if (uuid != null) - return uuid; - } - return null; - } - - private static String findSkullPlayers(String hash) { - // skulls - for (Entry> e : getSkinsCache().asMap().entrySet()) { - GameProfile profile = e.getKey(); - // stupid plugineers.. - if (profile.getId() == null) - continue; - Map textures = e.getValue(); - storeTexturesForProfile(profile, textures); - String uuid = findUUID(profile, textures, hash); - if (uuid != null) - return uuid; - } - - return null; - } - - private static String findUUID(GameProfile profile, Map textures, String hash) { - String uuid = playerHashes.get(hash); - for (MinecraftProfileTexture texture : textures.values()) { - if (hash.equals(texture.getHash())) { - uuid = trimUUID(profile.getId()); - playerHashes.put(hash, uuid); - break; - } - } - return uuid; - } - - private static void storeTexturesForProfile(GameProfile profile, Map textures) { - Map cached = getCachedTexturesForId(trimUUID(profile.getId())); - if (cached == null && textures != null && !textures.isEmpty()) { - LiteLoaderLogger.debug("Store textures for " + profile.getId()); - cachedTextures.put(trimUUID(profile.getId()), textures); + Minecraft.getMinecraft().getTextureManager().loadTexture(skin, threaddownloadimagedata); } } private static Map getTexturesForProfile(GameProfile profile) { LiteLoaderLogger.debug("Get textures for " + profile.getId(), new Object[0]); - Map cached = getCachedTexturesForId(trimUUID(profile.getId())); - if (cached != null) { - return cached; - } + Minecraft minecraft = Minecraft.getMinecraft(); MinecraftSessionService sessionService = minecraft.getSessionService(); Map textures = null; @@ -187,56 +114,41 @@ public final class HDSkinManager { && profile.getId().equals(minecraft.getSession().getProfile().getId())) { textures = sessionService.getTextures(sessionService.fillProfileProperties(profile, false), false); } - - storeTexturesForProfile(profile, textures); - return textures; } - private static Cache> getSkinsCache() { - if (skinsCache == null) { - // final field isn't going to change - skinsCache = HDPrivateFields.skinCacheLoader.get(Minecraft.getMinecraft().getSkinManager()); - } - return skinsCache; + public void setSkinUrl(String skinUrl) { + this.skinUrl = skinUrl; } - private static Map getCachedTexturesForId(String uuid) { - return cachedTextures.get(uuid); + public void setGatewayURL(String gatewayURL) { + this.gatewayUrl = gatewayURL; } - private static String trimUUID(UUID uuid) { - return uuid.toString().replace("-", ""); - } - - public static void setSkinUrl(String skinUrl) { - HDSkinManager.skinUrl = skinUrl; - } - - public static void setGatewayURL(String gatewayURL) { - gatewayUrl = gatewayURL; - } - - public static String getSkinUrl() { + public String getSkinUrl() { return String.format("http://%s/", skinUrl); } - public static String getGatewayUrl() { + public String getGatewayUrl() { return String.format("http://%s/", gatewayUrl); } - public static String getCustomSkinURLForId(String uuid, boolean gateway) { + public String getCustomSkinURLForId(String uuid, boolean gateway) { uuid = StringUtils.stripControlCodes(uuid); return String.format("http://%s/skins/%s.png", gateway ? gatewayUrl : skinUrl, uuid); } - public static String getCustomCloakURLForId(String uuid) { + public String getCustomCloakURLForId(String uuid) { return String.format("http://%s/capes/%s.png", skinUrl, StringUtils.stripControlCodes(uuid)); } + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + public static PreviewTexture getPreviewTexture(ResourceLocation skinResource, GameProfile profile) { TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); - Object skinTexture = textureManager.getTexture(skinResource); + ITextureObject skinTexture = textureManager.getTexture(skinResource); if (skinTexture == null) { Map textures = getTexturesForProfile(profile); @@ -244,7 +156,7 @@ public final class HDSkinManager { if (skin != null) { String url = skin.getUrl(); skinTexture = new PreviewTexture(url, DefaultPlayerSkin.getDefaultSkin(profile.getId()), new ImageBufferDownloadHD()); - textureManager.loadTexture(skinResource, (ITextureObject) skinTexture); + textureManager.loadTexture(skinResource, skinTexture); } } return (PreviewTexture) skinTexture; @@ -259,17 +171,14 @@ public final class HDSkinManager { } catch (IOException var1) { var1.printStackTrace(); } - // clear the maps, too - getSkinsCache().invalidateAll(); - cachedTextures.clear(); - playerHashes.clear(); + } - - public static void addSkinModifier(ISkinModifier modifier) { + + public void addSkinModifier(ISkinModifier modifier) { skinModifiers.add(modifier); } - static void updateSkin(BufferedImage image, Graphics dest) { + public void convertSkin(BufferedImage image, Graphics dest) { for (ISkinModifier skin : skinModifiers) { skin.convertSkin(image, dest); } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDThreadImageDownload.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDThreadImageDownload.java new file mode 100644 index 00000000..95cd2e27 --- /dev/null +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDThreadImageDownload.java @@ -0,0 +1,11 @@ +package com.voxelmodpack.hdskins; + +import net.minecraft.client.renderer.texture.SimpleTexture; + +public class HDThreadImageDownload extends SimpleTexture { + + public HDThreadImageDownload() { + super(null); + } + +} diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/ImageBufferDownloadHD.java b/src/hdskins/java/com/voxelmodpack/hdskins/ImageBufferDownloadHD.java index 3b3eda40..91c15739 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/ImageBufferDownloadHD.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/ImageBufferDownloadHD.java @@ -44,7 +44,7 @@ public class ImageBufferDownloadHD implements IImageBuffer { drawImage(48, 52, 44, 64, 52, 20, 56, 32); // mod things - HDSkinManager.updateSkin(image, graphics); + HDSkinManager.INSTANCE.convertSkin(image, graphics); graphics.dispose(); return image; diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinImageBufferDownload.java b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinImageBufferDownload.java new file mode 100644 index 00000000..a392b379 --- /dev/null +++ b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinImageBufferDownload.java @@ -0,0 +1,34 @@ +package com.voxelmodpack.hdskins.mixin; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At.Shift; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import com.voxelmodpack.hdskins.HDSkinManager; + +import net.minecraft.client.renderer.IImageBuffer; +import net.minecraft.client.renderer.ImageBufferDownload; + +@Mixin(ImageBufferDownload.class) +public abstract class MixinImageBufferDownload implements IImageBuffer { + + @Inject(method = "parseUserSkin", + require = 1, + locals = LocalCapture.CAPTURE_FAILHARD, + at = @At(value = "INVOKE", + shift = Shift.BEFORE, + target = "Ljava/awt/Graphics;dispose()V") ) + private void update(BufferedImage image, CallbackInfo ci, BufferedImage image2, Graphics graphics) { + // convert skins from legacy server + if (image.getHeight() == 32) { + HDSkinManager.INSTANCE.convertSkin(image2, graphics); + } + } + +} diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinPlayerInfo.java b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinPlayerInfo.java new file mode 100644 index 00000000..b926d4f1 --- /dev/null +++ b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinPlayerInfo.java @@ -0,0 +1,43 @@ +package com.voxelmodpack.hdskins.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.google.common.base.Optional; +import com.mojang.authlib.GameProfile; +import com.voxelmodpack.hdskins.HDSkinManager; + +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.util.ResourceLocation; + +@Mixin(NetworkPlayerInfo.class) +public abstract class MixinPlayerInfo { + + @Shadow + private GameProfile gameProfile; + + @Inject(method = "hasLocationSkin", + cancellable = true, + at = @At("RETURN") ) + private void hasLocationSkin(CallbackInfoReturnable ci) { + boolean has = ci.getReturnValueZ(); + if (!has) { + // in case has no skin + ci.setReturnValue(HDSkinManager.getSkin(gameProfile).isPresent()); + } + } + + @Inject(method = "getLocationSkin", + cancellable = true, + at = @At("RETURN") ) + private void getLocationSkin(CallbackInfoReturnable ci) { + Optional skin = HDSkinManager.getSkin(gameProfile); + if (skin.isPresent()) { + // set the skin + ci.setReturnValue(skin.get()); + } + } +} diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java new file mode 100644 index 00000000..af59c441 --- /dev/null +++ b/src/hdskins/java/com/voxelmodpack/hdskins/mixin/MixinSkullRenderer.java @@ -0,0 +1,37 @@ +package com.voxelmodpack.hdskins.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.At.Shift; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.google.common.base.Optional; +import com.mojang.authlib.GameProfile; +import com.voxelmodpack.hdskins.HDSkinManager; + +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +@Mixin(TileEntitySkullRenderer.class) +public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer { + + @Inject(method = "renderSkull", + require = 1, + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", + ordinal = 4, + shift = Shift.AFTER) ) + private void onBindTexture(float x, float y, float z, EnumFacing facing, float rotation, int meta, GameProfile profile, int p_180543_8_, + CallbackInfo ci) { + if (profile != null) { + Optional skin = HDSkinManager.getSkin(profile); + if (skin.isPresent()) + // rebind + bindTexture(skin.get()); + } + } +} diff --git a/src/hdskins/resources/events.json b/src/hdskins/resources/events.json deleted file mode 100644 index 2bd4a8fd..00000000 --- a/src/hdskins/resources/events.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "obfuscation": { - "classes": [ - { "id": "ThreadDownloadImageData", "mcp": "net.minecraft.client.renderer.ThreadDownloadImageData", "obf": "ctq"}, - { "id": "HDSkinManager", "mcp": "com.voxelmodpack.hdskins.HDSkinManager" } - ], - "methods": [ - { "id": "loadTextureFromServer", "mcp": "loadTextureFromServer", "srg": "func_152433_a", "obf": "d" } - ] - }, - "descriptors": [ - { "id": "start", "owner": "java.lang.Thread", "name": "start", "return": "VOID", "args": [] }, - { "id": "loadTextureFromServer", "owner": "${ThreadDownloadImageData}", "name": "${loadTextureFromServer}", "return": "VOID", "args": [] }, - { "id": "onDownloadSkin", "owner": "${HDSkinManager}", "name": "onDownloadSkin" } - ], - "events": [ - { - "name": "onDownloadSkin", - "cancellable": "true", - "injections": [{ - "type": "INVOKE", - "method": "${loadTextureFromServer}", - "target": "${start}" - }], - "listeners": [ "${onDownloadSkin}" ] - } - ] -} diff --git a/src/hdskins/resources/mixin.hdskins.json b/src/hdskins/resources/mixin.hdskins.json new file mode 100644 index 00000000..e51b4472 --- /dev/null +++ b/src/hdskins/resources/mixin.hdskins.json @@ -0,0 +1,9 @@ +{ + "package": "com.voxelmodpack.hdskins.mixin", + "refmap": "mixin.hdskins.refmap.json", + "mixins": [ + "MixinImageBufferDownload", + "MixinPlayerInfo", + "MixinSkullRenderer" + ] +} \ No newline at end of file diff --git a/src/main/java/com/brohoof/minelittlepony/MineLittlePony.java b/src/main/java/com/brohoof/minelittlepony/MineLittlePony.java index 76958603..e4394e65 100644 --- a/src/main/java/com/brohoof/minelittlepony/MineLittlePony.java +++ b/src/main/java/com/brohoof/minelittlepony/MineLittlePony.java @@ -83,13 +83,14 @@ public class MineLittlePony implements InitCompleteListener { @Override public void onInitCompleted(Minecraft minecraft, LiteLoader loader) { - if (this.config.getHd().get()) { - HDSkinManager.clearSkinCache(); - HDSkinManager.setSkinUrl(SKIN_SERVER_URL); - HDSkinManager.setGatewayURL(GATEWAY_URL); - HDSkinManager.addSkinModifier(new PonySkinModifier()); - MineLPLogger.info("Set MineLP skin server URL."); - } + + HDSkinManager.clearSkinCache(); + HDSkinManager manager = HDSkinManager.INSTANCE; + manager.setSkinUrl(config.skinfix ? GATEWAY_URL : SKIN_SERVER_URL); + manager.setGatewayURL(GATEWAY_URL); + manager.addSkinModifier(new PonySkinModifier()); + MineLPLogger.info("Set MineLP skin server URL."); + RenderManager rm = minecraft.getRenderManager(); ModUtilities.addRenderer(EntityPonyModel.class, new RenderPonyModel(rm)); if (this.config.getVillagers().get()) { @@ -127,6 +128,7 @@ public class MineLittlePony implements InitCompleteListener { if (pressed || skins) { minecraft.displayGuiScreen(new GuiSkinsMineLP(ponyManager)); } + HDSkinManager.INSTANCE.setEnabled(config.getHd().get()); } public PonyManager getManager() { diff --git a/src/main/java/com/brohoof/minelittlepony/Pony.java b/src/main/java/com/brohoof/minelittlepony/Pony.java index 04a4e02e..b6a8cf00 100644 --- a/src/main/java/com/brohoof/minelittlepony/Pony.java +++ b/src/main/java/com/brohoof/minelittlepony/Pony.java @@ -103,11 +103,7 @@ public class Pony { return player.capabilities.isFlying || !(player.onGround || player.isOnLadder() || player.isInWater()); } - public PlayerModel getModel() { - return getModel(false); - } - - public PlayerModel getModel(boolean ignorePony) { + public PlayerModel getModel(boolean ignorePony, boolean smallArms) { boolean is_a_pony = false; switch (ignorePony ? PonyLevel.BOTH : config.getPonyLevel().get()) { case HUMANS: @@ -122,9 +118,9 @@ public class Pony { PlayerModel model; if (is_a_pony) { - model = PMAPI.pony; + model = smallArms ? PMAPI.ponySmall : PMAPI.pony; } else { - model = PMAPI.human; + model = smallArms ? PMAPI.humanSmall : PMAPI.human; } return model; } diff --git a/src/main/java/com/brohoof/minelittlepony/PonyConfig.java b/src/main/java/com/brohoof/minelittlepony/PonyConfig.java index 0a6475a0..5a1d73b0 100644 --- a/src/main/java/com/brohoof/minelittlepony/PonyConfig.java +++ b/src/main/java/com/brohoof/minelittlepony/PonyConfig.java @@ -31,6 +31,8 @@ public class PonyConfig implements AdvancedExposable { private Value pigzombies = new Value(true); @Expose private Value skeletons = new Value(true); + @Expose + public boolean skinfix = true; public Value getPonyLevel() { if (ponylevel.get() == null) diff --git a/src/main/java/com/brohoof/minelittlepony/hdskins/gui/RenderPonyModel.java b/src/main/java/com/brohoof/minelittlepony/hdskins/gui/RenderPonyModel.java index 478b070b..40e2023b 100644 --- a/src/main/java/com/brohoof/minelittlepony/hdskins/gui/RenderPonyModel.java +++ b/src/main/java/com/brohoof/minelittlepony/hdskins/gui/RenderPonyModel.java @@ -21,7 +21,8 @@ public class RenderPonyModel extends RenderPlayerModel { EntityPlayerModel playerModelEntity = (EntityPlayerModel) par1EntityLivingBase; Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(this.getEntityTexture(playerModelEntity)); thePony.checkSkin(); - PlayerModel pm = thePony.getModel(true); + // TODO small arms + PlayerModel pm = thePony.getModel(true, false); this.mainModel = pm.getModel(); pm.apply(thePony.metadata); this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); diff --git a/src/main/java/com/brohoof/minelittlepony/mixin/MixinRenderPlayer.java b/src/main/java/com/brohoof/minelittlepony/mixin/MixinRenderPlayer.java index c110abca..9e528bd0 100644 --- a/src/main/java/com/brohoof/minelittlepony/mixin/MixinRenderPlayer.java +++ b/src/main/java/com/brohoof/minelittlepony/mixin/MixinRenderPlayer.java @@ -4,6 +4,7 @@ import static net.minecraft.client.renderer.GlStateManager.scale; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -34,6 +35,8 @@ import net.minecraft.util.ResourceLocation; @Mixin(RenderPlayer.class) public abstract class MixinRenderPlayer extends RendererLivingEntity implements IRenderPony { + @Shadow + private boolean smallArms; private PlayerModel playerModel; private Pony thePony; @@ -41,9 +44,11 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements super(renderManager, null, 0.5F); } - @Inject(method="(Lnet/minecraft/client/renderer/entity/RenderManager;Z)V", at=@At("RETURN")) + @Inject( + method = "(Lnet/minecraft/client/renderer/entity/RenderManager;Z)V", + at = @At("RETURN") ) private void init(RenderManager renderManager, boolean useSmallArms, CallbackInfo ci) { - this.playerModel = PMAPI.pony; + this.playerModel = smallArms ? PMAPI.ponySmall : PMAPI.pony; this.mainModel = this.playerModel.getModel(); this.shadowSize = this.playerModel.getShadowsize(); this.layerRenderers.clear(); @@ -77,7 +82,7 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements this.playerModel.getModel().isFlying = thePony.isPegasusFlying(player); if (MineLittlePony.getConfig().getShowScale().get()) { - if (this.playerModel != PMAPI.human) { + if (this.playerModel.getModel().metadata.getRace() != null) { PonySize size = thePony.metadata.getSize(); if (size == PonySize.FOAL) this.shadowSize = 0.25F; @@ -110,7 +115,7 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements this.playerModel.getModel().heldItemRight = 0; } - @Inject(method = "renderLivingAt", at = @At("RETURN")) + @Inject(method = "renderLivingAt", at = @At("RETURN") ) private void setupPlayerScale(AbstractClientPlayer player, double xPosition, double yPosition, double zPosition, CallbackInfo ci) { if (MineLittlePony.getConfig().getShowScale().get() && !(playerModel.getModel() instanceof ModelHumanPlayer)) { @@ -133,8 +138,9 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements } private PlayerModel getModel(AbstractClientPlayer player) { - Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(player); - return thePony.getModel(); + ResourceLocation skin = getEntityTexture(player); + Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(skin); + return thePony.getModel(false, this.smallArms); } @Override diff --git a/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java b/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java index dbb388bc..404961e0 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java +++ b/src/main/java/com/brohoof/minelittlepony/model/AbstractPonyModel.java @@ -6,8 +6,6 @@ import static net.minecraft.client.renderer.GlStateManager.translate; import java.util.List; -import com.brohoof.minelittlepony.MineLittlePony; -import com.brohoof.minelittlepony.Pony; import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.model.part.IPonyPart; @@ -16,13 +14,11 @@ import com.brohoof.minelittlepony.renderer.AniParams; import com.brohoof.minelittlepony.renderer.PlaneRenderer; import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.item.EnumAction; @@ -31,6 +27,12 @@ import net.minecraft.item.ItemStack; public abstract class AbstractPonyModel extends ModelPlayer { protected float scale = 0.0625F; + + public ModelRenderer steveLeftArm; + public ModelRenderer steveRightArm; + public ModelRenderer steveLeftArmwear; + public ModelRenderer steveRightArmwear; + public boolean isArmour = false; public boolean isVillager; public boolean isFlying; @@ -40,8 +42,12 @@ public abstract class AbstractPonyModel extends ModelPlayer { protected List modelParts = Lists.newArrayList(); - public AbstractPonyModel() { - super(0, false); + public AbstractPonyModel(boolean arms) { + super(0, arms); + this.steveLeftArm = this.bipedLeftArm; + this.steveRightArm = this.bipedRightArm; + this.steveLeftArmwear = this.bipedLeftArmwear; + this.steveRightArmwear = this.bipedLeftArmwear; } public final void init(float yOffset, float stretch) { @@ -85,44 +91,15 @@ public abstract class AbstractPonyModel extends ModelPlayer { } @Override - public final void renderRightArm() { - // Use the human model - PMAPI.human.getModel().renderModelRightArm(); + public void renderRightArm() { + this.steveRightArm.render(0.0625F); + this.steveRightArmwear.render(0.0625F); } @Override - public final void renderLeftArm() { - // Use the human model - PMAPI.human.getModel().renderModelLeftArm(); - } - - @Override - public final void setRotationAngles(float f1, float f2, float f3, float f4, float f5, float f6, Entity ent) { - // set the angles for the humans in preparation for arm rendering - // Comes from RenderPlayer.render[Left|Right]Arm? - if (PMAPI.human.getModel() != this - && Thread.currentThread().getStackTrace()[2].getClassName().equals(RenderPlayer.class.getName())) { - PMAPI.human.getModel().setModelVisibilities((AbstractClientPlayer) ent); - PMAPI.human.getModel().isSneak = isSneak; - PMAPI.human.getModel().swingProgress = swingProgress; - PMAPI.human.getModel().setModelRotationAngles(f1, f2, f3, f4, f5, f6, ent); - // override default skin - Pony pony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry((AbstractClientPlayer) ent); - Minecraft.getMinecraft().getTextureManager().bindTexture(pony.getTextureResourceLocation()); - } - setModelRotationAngles(f1, f2, f3, f4, f5, f6, ent); - } - - protected void renderModelRightArm() { - super.renderRightArm(); - } - - protected void renderModelLeftArm() { - super.renderLeftArm(); - } - - protected void setModelRotationAngles(float f1, float f2, float f3, float f4, float f5, float f6, Entity ent) { - super.setRotationAngles(f1, f2, f3, f4, f5, f6, ent); + public void renderLeftArm() { + this.steveLeftArm.render(0.0625f); + this.steveLeftArmwear.render(0.0625f); } protected void setModelVisibilities(AbstractClientPlayer clientPlayer) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java b/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java index f2423a80..a7e10e0f 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java +++ b/src/main/java/com/brohoof/minelittlepony/model/PMAPI.java @@ -14,11 +14,13 @@ import com.brohoof.minelittlepony.model.pony.armor.ZombiePonyArmors; public final class PMAPI { - public static final PlayerModel pony = new PlayerModel(new ModelPlayerPony()).setArmor(new PonyArmors()); + public static final PlayerModel pony = new PlayerModel(new ModelPlayerPony(false)).setArmor(new PonyArmors()); + public static final PlayerModel ponySmall = new PlayerModel(new ModelPlayerPony(true)).setArmor(new PonyArmors()); public static final PlayerModel zombie = new PlayerModel(new ModelZombiePony()).setArmor(new ZombiePonyArmors()); public static final PlayerModel skeleton = new PlayerModel(new ModelSkeletonPony()).setArmor(new SkeletonPonyArmors()); public static final PlayerModel villager = new PlayerModel(new ModelVillagerPony()).setArmor(new PonyArmors()); - public static final PlayerModel human = new PlayerModel(new ModelHumanPlayer()).setArmor(new HumanArmors()); + public static final PlayerModel human = new PlayerModel(new ModelHumanPlayer(false)).setArmor(new HumanArmors()); + public static final PlayerModel humanSmall = new PlayerModel(new ModelHumanPlayer(true)).setArmor(new HumanArmors()); public static void init() { for (Field field : PMAPI.class.getFields()) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelHumanPlayer.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelHumanPlayer.java index f081b758..23165e08 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelHumanPlayer.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelHumanPlayer.java @@ -9,6 +9,10 @@ public class ModelHumanPlayer extends AbstractPonyModel { public ModelRenderer bipedEars; public ModelRenderer cloak; + public ModelHumanPlayer(boolean smallArms) { + super(smallArms); + } + @Override protected boolean doCancelRender() { return true; diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java index 48ceb7e0..787a7a98 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelPlayerPony.java @@ -24,20 +24,22 @@ import net.minecraft.util.MathHelper; public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConstants { + private final boolean smallArms; public boolean rainboom; public ModelRenderer bipedCape; public PlaneRenderer[] Bodypiece; public PlaneRenderer[] BodypieceNeck; - public ModelRenderer SteveArm; public ModelRenderer unicornarm; public PlaneRenderer[] Tail; - public ModelPlayerPony() { + public ModelPlayerPony(boolean smallArms) { + super(smallArms); + this.smallArms = smallArms; addParts(); } - + protected void addParts() { modelParts.add(new PonyEars()); modelParts.add(new PonySnout()); @@ -62,7 +64,6 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.Bodypiece[k1].rotateAngleY = bodySwingRotation * 0.2F; } - for (k1 = 0; k1 < this.BodypieceNeck.length; ++k1) { this.BodypieceNeck[k1].rotateAngleY = bodySwingRotation * 0.2F; } @@ -193,7 +194,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst leftLegRotateAngleX = MathHelper.sin(swing * 0.5F); } - this.SteveArm.rotateAngleY = 0.2F; + this.steveRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F; this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F; @@ -209,7 +210,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing; rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing; - this.SteveArm.rotateAngleY = 0.0F; + this.steveRightArm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F; @@ -219,7 +220,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; - this.SteveArm.rotateAngleX = rightArmRotateAngleX; + this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = 0.0F; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; @@ -227,7 +228,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedRightArm.rotateAngleZ = 0.0F; - this.SteveArm.rotateAngleZ = 0.0F; + this.steveRightArm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; } @@ -237,7 +238,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst float cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; float legOutset = 4.0F; if (this.isSneak && !this.isFlying) { - legOutset = 0.0F; + legOutset = smallArms ? 1.0F : 0F; } if (this.isSleeping) { @@ -246,17 +247,17 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst if (this.rainboom) { this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F; - this.SteveArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F; + this.steveRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F; this.bipedLeftArm.rotationPointZ = 0.0F - sinBodyRotateAngleYFactor + 2.0F; } else { this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F; - this.SteveArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F; + this.steveRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F; this.bipedLeftArm.rotationPointZ = 0.0F - sinBodyRotateAngleYFactor + 1.0F; } - this.SteveArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor; + this.steveRightArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor; this.bipedRightArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset; - this.bipedLeftArm.rotationPointX = cosBodyRotateAngleYFactor + 1.0F - legOutset; + this.bipedLeftArm.rotationPointX = cosBodyRotateAngleYFactor + 2.0F - legOutset; this.bipedRightLeg.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset; this.bipedLeftLeg.rotationPointX = cosBodyRotateAngleYFactor + 1.0F - legOutset; @@ -302,7 +303,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst protected void holdItem() { if (this.heldItemRight != 0 && !this.rainboom && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.3141593F; - this.SteveArm.rotateAngleX = this.SteveArm.rotateAngleX * 0.5F - 0.3141593F; + this.steveRightArm.rotateAngleX = this.steveRightArm.rotateAngleX * 0.5F - 0.3141593F; } } @@ -323,9 +324,9 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedRightArm.rotateAngleX = (float) (this.bipedRightArm.rotateAngleX - (f22 * 1.2D + f33)); this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; this.bipedRightArm.rotateAngleZ = f28 * -0.4F; - this.SteveArm.rotateAngleX = (float) (this.SteveArm.rotateAngleX - (f22 * 1.2D + f33)); - this.SteveArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; - this.SteveArm.rotateAngleZ = f28 * -0.4F; + this.steveRightArm.rotateAngleX = (float) (this.steveRightArm.rotateAngleX - (f22 * 1.2D + f33)); + this.steveRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.steveRightArm.rotateAngleZ = f28 * -0.4F; } } @@ -341,8 +342,8 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } else { this.bipedRightArm.rotateAngleZ += cosTickFactor; this.bipedRightArm.rotateAngleX += sinTickFactor; - this.SteveArm.rotateAngleZ += cosTickFactor; - this.SteveArm.rotateAngleX += sinTickFactor; + this.steveRightArm.rotateAngleZ += cosTickFactor; + this.steveRightArm.rotateAngleX += sinTickFactor; } } @@ -376,7 +377,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } protected void sneakLegs() { - this.SteveArm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; + this.steveRightArm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.unicornarm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.bipedRightArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT; @@ -713,24 +714,18 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst this.bipedRightArm = new ModelRenderer(this, 40, 16); this.bipedRightLeg = new ModelRenderer(this, 0, 16); - if (this.textureHeight == 64) { - this.bipedLeftArm = new ModelRenderer(this, 32, 48); - this.bipedLeftLeg = new ModelRenderer(this, 16, 48); + this.bipedLeftArm = new ModelRenderer(this, 32, 48); + this.bipedLeftLeg = new ModelRenderer(this, 16, 48); - this.bipedRightArmwear = new ModelRenderer(this, 40, 32); - this.bipedRightLegwear = new ModelRenderer(this, 0, 32); + this.bipedRightArmwear = new ModelRenderer(this, 40, 32); + this.bipedRightLegwear = new ModelRenderer(this, 0, 32); + + this.bipedLeftArmwear = new ModelRenderer(this, 48, 48); + this.bipedLeftLegwear = new ModelRenderer(this, 0, 48); - this.bipedLeftArmwear = new ModelRenderer(this, 48, 48); - this.bipedLeftLegwear = new ModelRenderer(this, 0, 48); - } else { - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - } - this.SteveArm = new ModelRenderer(this, 40, 16).setTextureSize(64, 64); this.unicornarm = new ModelRenderer(this, 40, 32).setTextureSize(64, 64); - this.boxList.remove(this.SteveArm); + + this.boxList.remove(this.steveRightArm); this.boxList.remove(this.unicornarm); } @@ -824,17 +819,32 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst } protected void initLegPositions(float yOffset, float stretch) { - this.bipedRightArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); - this.bipedRightArm.setRotationPoint(-3.0F, 8.0F + yOffset, 0.0F); - if (bipedRightArmwear != null) { - this.bipedRightArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); - this.bipedRightArmwear.setRotationPoint(-3.0F, 8.0F + yOffset, 0.0F); - } - this.bipedLeftArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); - this.bipedLeftArm.setRotationPoint(3.0F, 8.0F + yOffset, 0.0F); - if (this.bipedLeftArmwear != null) { - this.bipedLeftArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); - this.bipedLeftArmwear.setRotationPoint(3.0F, 8.0F + yOffset, 0.0F); + if (this.smallArms) { + this.bipedRightArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 3, 12, 4, stretch); + this.bipedRightArm.setRotationPoint(-2.0F, 8.5F + yOffset, 0.0F); + if (bipedRightArmwear != null) { + this.bipedRightArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 3, 12, 4, stretch + 0.25f); + this.bipedRightArmwear.setRotationPoint(-3.0F, 8.5F + yOffset, 0.0F); + } + this.bipedLeftArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 3, 12, 4, stretch); + this.bipedLeftArm.setRotationPoint(3.0F, 8.5F + yOffset, 0.0F); + if (this.bipedLeftArmwear != null) { + this.bipedLeftArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 3, 12, 4, stretch + 0.25f); + this.bipedLeftArmwear.setRotationPoint(3.0F, 8.5F + yOffset, 0.0F); + } + } else { + this.bipedRightArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); + this.bipedRightArm.setRotationPoint(-3.0F, 8.0F + yOffset, 0.0F); + if (bipedRightArmwear != null) { + this.bipedRightArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); + this.bipedRightArmwear.setRotationPoint(-3.0F, 8.0F + yOffset, 0.0F); + } + this.bipedLeftArm.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); + this.bipedLeftArm.setRotationPoint(3.0F, 8.0F + yOffset, 0.0F); + if (this.bipedLeftArmwear != null) { + this.bipedLeftArmwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); + this.bipedLeftArmwear.setRotationPoint(3.0F, 8.0F + yOffset, 0.0F); + } } this.bipedRightLeg.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); this.bipedRightLeg.setRotationPoint(-3.0F, 0.0F + yOffset, 0.0F); @@ -849,8 +859,6 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst if (this.bipedLeftLegwear != null) { this.bipedLeftLegwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); } - this.SteveArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, stretch); - this.SteveArm.setRotationPoint(-5.0F, 2.0F + yOffset, 0.0F); this.unicornarm.addBox(-2.0F + FIRSTP_ARM_CENTRE_X, -6.0F + FIRSTP_ARM_CENTRE_Y, -2.0F + FIRSTP_ARM_CENTRE_Z, 4, 12, 4, stretch + .25f); this.unicornarm.setRotationPoint(-5.0F, 2.0F + yOffset, 0.0F); } diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java index d424469c..2df782b9 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelSkeletonPony.java @@ -8,7 +8,11 @@ import static net.minecraft.client.renderer.GlStateManager.translate; import net.minecraft.util.MathHelper; public class ModelSkeletonPony extends ModelPlayerPony { - + + public ModelSkeletonPony() { + super(false); + } + @Override protected void rotateLegs(float move, float swing, float tick) { float rightArmRotateAngleX; @@ -31,7 +35,7 @@ public class ModelSkeletonPony extends ModelPlayerPony { } this.bipedRightArm.rotateAngleY = 0.2F; - this.SteveArm.rotateAngleY = 0.2F; + this.steveRightArm.rotateAngleY = 0.2F; this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedLeftLeg.rotateAngleY = 0.2F; @@ -50,7 +54,7 @@ public class ModelSkeletonPony extends ModelPlayerPony { rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing; this.bipedRightArm.rotateAngleY = 0.0F; - this.SteveArm.rotateAngleY = 0.0F; + this.steveRightArm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F; @@ -58,13 +62,13 @@ public class ModelSkeletonPony extends ModelPlayerPony { } this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; - this.SteveArm.rotateAngleX = rightArmRotateAngleX; + this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = rightArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedRightArm.rotateAngleZ = 0.0F; - this.SteveArm.rotateAngleZ = 0.0F; + this.steveRightArm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; if (this.heldItemRight != 0) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java index c2e501e0..b694af80 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelVillagerPony.java @@ -13,6 +13,10 @@ public class ModelVillagerPony extends ModelPlayerPony { public int profession; + public ModelVillagerPony() { + super(false); + } + @Override public void animate(AniParams aniparams) { super.animate(aniparams); diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java index f198ab41..7a8a7a58 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/ModelZombiePony.java @@ -6,6 +6,10 @@ import net.minecraft.util.MathHelper; public class ModelZombiePony extends ModelPlayerPony { + public ModelZombiePony() { + super(false); + } + @Override protected void rotateLegs(float move, float swing, float tick) { float rightArmRotateAngleX; @@ -29,7 +33,7 @@ public class ModelZombiePony extends ModelPlayerPony { } this.bipedRightArm.rotateAngleY = 0.2F; - this.SteveArm.rotateAngleY = 0.2F; + this.steveRightArm.rotateAngleY = 0.2F; this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedLeftLeg.rotateAngleY = 0.2F; @@ -48,7 +52,7 @@ public class ModelZombiePony extends ModelPlayerPony { rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing; this.bipedRightArm.rotateAngleY = 0.0F; - this.SteveArm.rotateAngleY = 0.0F; + this.steveRightArm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F; @@ -56,13 +60,13 @@ public class ModelZombiePony extends ModelPlayerPony { } this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; - this.SteveArm.rotateAngleX = rightArmRotateAngleX; + this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = 0.0F; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedRightArm.rotateAngleZ = 0.0F; - this.SteveArm.rotateAngleZ = 0.0F; + this.steveRightArm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; if (this.heldItemRight == 0) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/HumanArmors.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/HumanArmors.java index 3ff90521..500477ba 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/HumanArmors.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/HumanArmors.java @@ -6,8 +6,8 @@ import com.brohoof.minelittlepony.model.pony.ModelHumanPlayer; public class HumanArmors extends AbstractArmor { public HumanArmors() { - this.modelArmorChestplate = new ModelHumanPlayer(); - this.modelArmor = new ModelHumanPlayer(); + this.modelArmorChestplate = new ModelHumanPlayer(false); + this.modelArmor = new ModelHumanPlayer(false); } } diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java index c1a20121..dca55a7a 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelPonyArmor.java @@ -16,6 +16,7 @@ public class ModelPonyArmor extends ModelPlayerPony { public ModelRenderer[] extLegs; public ModelPonyArmor() { + super(false); this.isArmour = true; this.textureHeight = 32; } @@ -194,7 +195,7 @@ public class ModelPonyArmor extends ModelPlayerPony { this.bipedRightLeg = new ModelRenderer(this, 0, 16); this.bipedLeftLeg = new ModelRenderer(this, 0, 16); this.bipedLeftLeg.mirror = true; - this.SteveArm = new ModelRenderer(this, 0, 16); + this.steveRightArm = new ModelRenderer(this, 0, 16); this.unicornarm = new ModelRenderer(this, 0, 16); this.extLegs[0] = new ModelRenderer(this, 48, 8); this.extLegs[1] = new ModelRenderer(this, 48, 8); diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java index 6cd3cfcf..71f2c610 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelSkeletonPonyArmor.java @@ -28,7 +28,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor { } this.bipedRightArm.rotateAngleY = 0.2F; - this.SteveArm.rotateAngleY = 0.2F; + this.steveRightArm.rotateAngleY = 0.2F; this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedLeftLeg.rotateAngleY = 0.2F; @@ -43,7 +43,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor { rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing; this.bipedRightArm.rotateAngleY = 0.0F; - this.SteveArm.rotateAngleY = 0.0F; + this.steveRightArm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F; @@ -51,13 +51,13 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor { } this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; - this.SteveArm.rotateAngleX = rightArmRotateAngleX; + this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = 0.0F; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedRightArm.rotateAngleZ = 0.0F; - this.SteveArm.rotateAngleZ = 0.0F; + this.steveRightArm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; if (this.heldItemRight != 0) { diff --git a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java index 106d5819..19c9ea75 100644 --- a/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java +++ b/src/main/java/com/brohoof/minelittlepony/model/pony/armor/ModelZombiePonyArmor.java @@ -28,7 +28,7 @@ public class ModelZombiePonyArmor extends ModelPonyArmor { } this.bipedRightArm.rotateAngleY = 0.2F; - this.SteveArm.rotateAngleY = 0.2F; + this.steveRightArm.rotateAngleY = 0.2F; this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedLeftLeg.rotateAngleY = 0.2F; @@ -43,7 +43,7 @@ public class ModelZombiePonyArmor extends ModelPonyArmor { rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing; this.bipedRightArm.rotateAngleY = 0.0F; - this.SteveArm.rotateAngleY = 0.0F; + this.steveRightArm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F; @@ -51,13 +51,13 @@ public class ModelZombiePonyArmor extends ModelPonyArmor { } this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; - this.SteveArm.rotateAngleX = rightArmRotateAngleX; + this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = 0.0F; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedRightArm.rotateAngleZ = 0.0F; - this.SteveArm.rotateAngleZ = 0.0F; + this.steveRightArm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; if (this.heldItemRight == 0) { diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerHeldPonyItem.java b/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerHeldPonyItem.java index ce6a46e1..9c907902 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerHeldPonyItem.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerHeldPonyItem.java @@ -6,7 +6,6 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; import com.brohoof.minelittlepony.PonySize; -import com.brohoof.minelittlepony.model.PMAPI; import com.brohoof.minelittlepony.model.PlayerModel; import com.brohoof.minelittlepony.model.pony.ModelPlayerPony; import com.brohoof.minelittlepony.renderer.IRenderPony; @@ -43,7 +42,7 @@ public class LayerHeldPonyItem implements LayerRenderer { public void doRenderLayer(EntityLivingBase entity, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { PlayerModel pony = ((IRenderPony) livingPonyEntity).getPony(); - if (pony == PMAPI.human) { + if (pony.getModel().metadata.getRace() == null) { held.doRenderLayer(entity, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale); return; diff --git a/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerPonyCape.java b/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerPonyCape.java index cdf4884d..efaf2b1c 100644 --- a/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerPonyCape.java +++ b/src/main/java/com/brohoof/minelittlepony/renderer/layer/LayerPonyCape.java @@ -3,7 +3,6 @@ package com.brohoof.minelittlepony.renderer.layer; import static net.minecraft.client.renderer.GlStateManager.*; import com.brohoof.minelittlepony.PonySize; -import com.brohoof.minelittlepony.model.PMAPI; import com.brohoof.minelittlepony.model.PlayerModel; import com.brohoof.minelittlepony.renderer.IRenderPony; @@ -35,7 +34,7 @@ public class LayerPonyCape implements LayerRenderer { public void doRenderLayer(AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6, float p7, float scale) { PlayerModel model = ((IRenderPony) renderer).getPony(); - if (model == PMAPI.human) { + if (model.getModel().metadata.getRace() == null) { cape.doRenderLayer(clientPlayer, p2, p3, ticks, p5, p6, p7, scale); } else if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible() && clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null) { diff --git a/src/main/resources/assets/minelittlepony/lang/en_US.lang b/src/main/resources/assets/minelittlepony/lang/en_US.lang index 2312976d..159b7f54 100644 --- a/src/main/resources/assets/minelittlepony/lang/en_US.lang +++ b/src/main/resources/assets/minelittlepony/lang/en_US.lang @@ -7,7 +7,7 @@ minelp.options.ponylevel.ponies=Ponies Only minelp.options.ponylevel.humans=Humans Only minelp.options.ponylevel.both=Both minelp.options.options=Pony Options -minelp.options.hd=Enable MineLP skin server (requries restart) +minelp.options.hd=Enable MineLP skin server minelp.options.sizes=Allow all different sizes of pony minelp.options.snuzzles=Display snuzzles on ponies minelp.options.showscale=Use show-accurate scaling diff --git a/src/main/resources/assets/minelittlepony/lang/fr_FR.lang b/src/main/resources/assets/minelittlepony/lang/fr_FR.lang index 4e3c3ae5..c8bf31f0 100644 --- a/src/main/resources/assets/minelittlepony/lang/fr_FR.lang +++ b/src/main/resources/assets/minelittlepony/lang/fr_FR.lang @@ -9,7 +9,7 @@ minelp.options.ponylevel.ponies=Seuls Poneys minelp.options.ponylevel.humans=Seuls Humains minelp.options.ponylevel.both=Deux minelp.options.options=Options Poney -minelp.options.hd=Activer MineLP serveur de skin (nécessite un redémarrage) +minelp.options.hd=Activer MineLP serveur de skin minelp.options.sizes=Autoriser tous les différentes tailles de poney minelp.options.ponyarmor=Utiliser armure compatible de MineLP minelp.options.snuzzles=Afficher museau sur les poneys diff --git a/src/main/resources/assets/minelittlepony/lang/ru_RU.lang b/src/main/resources/assets/minelittlepony/lang/ru_RU.lang index 565a8177..3ee46a4d 100644 --- a/src/main/resources/assets/minelittlepony/lang/ru_RU.lang +++ b/src/main/resources/assets/minelittlepony/lang/ru_RU.lang @@ -6,7 +6,7 @@ minelp.options.ponylevel.ponies=Только пони minelp.options.ponylevel.humans=Только люди minelp.options.ponylevel.both=И то и другое minelp.options.options=Опции -minelp.options.hd=Включить Mine Little Pony скин-сервер (требуется перезапуск) +minelp.options.hd=Включить Mine Little Pony скин-сервер minelp.options.sizes=Разрешить пони разных размеров и расс minelp.options.ponyarmor=Использовать текстуры брони совместимые с модом minelp.options.snuzzles=Показывать объёмные носы