Port hdskins to mixins.

Other changes to HDSkinManager
Allow hd skins to be toggled on demand
Support small arms.
This commit is contained in:
Matthew Messinger 2016-01-19 00:34:07 -05:00
parent 15ce8e7ed0
commit 45f408cf1b
33 changed files with 371 additions and 445 deletions

View file

@ -43,16 +43,20 @@ sourceSets {
configurations.forgeGradleMc, configurations.forgeGradleMc,
configurations.provided configurations.provided
] ]
main {
refMap = 'mixin.minelp.refmap.json'
}
common { common {
compileClasspath += files deps compileClasspath += files deps
} }
hdskins { hdskins {
compileClasspath += files deps compileClasspath += files deps
refMap = 'mixin.hdskins.refmap.json'
} }
} }
project('forge') { project('forge') {
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'
version = '0' version = '0.0'
minecraft { minecraft {
version = '1.8-11.14.3.1543' version = '1.8-11.14.3.1543'
mappings = rootProject.minecraft.mappings mappings = rootProject.minecraft.mappings

View file

@ -5,7 +5,7 @@
"revision": "${revision}", "revision": "${revision}",
"author": "Verdana, Rene_Z, Mumfrey, JoyJoy", "author": "Verdana, Rene_Z, Mumfrey, JoyJoy",
"voxelCommonJarName": "voxelcommon-2.4.0.jar", "voxelCommonJarName": "voxelcommon-2.4.0.jar",
"mixinConfigs": "mixin.minelp.json", "mixinConfigs": [ "mixin.minelp.json", "mixin.hdskins.json" ],
"description": "Mine Little Pony turns players and mobs into ponies", "description": "Mine Little Pony turns players and mobs into ponies",
"description.minelittlepony": "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." "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."

View file

@ -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<P, T> extends PrivateFields<P, T> {
public static PrivateFields<SkinManager, Cache<GameProfile, Map<Type, MinecraftProfileTexture>>> skinCacheLoader = new HDPrivateFields<SkinManager, Cache<GameProfile, Map<Type, MinecraftProfileTexture>>>(
SkinManager.class, HDObf.skinLoadingCache);
protected HDPrivateFields(Class<P> 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);
}
}
}

View file

@ -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;
}
}

View file

@ -4,16 +4,12 @@ import java.awt.Graphics;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import org.apache.commons.io.FileUtils; 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.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile; 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;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.util.UUIDTypeAdapter;
import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.core.LiteLoader;
import com.mumfrey.liteloader.transformers.event.EventInfo;
import com.mumfrey.liteloader.util.log.LiteLoaderLogger; import com.mumfrey.liteloader.util.log.LiteLoaderLogger;
import com.voxelmodpack.common.runtime.PrivateFields;
import net.minecraft.client.Minecraft; 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.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.DefaultPlayerSkin; 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.ResourceLocation;
import net.minecraft.util.StringUtils; import net.minecraft.util.StringUtils;
import net.minecraft.world.World;
public final class HDSkinManager { public final class HDSkinManager {
private static String gatewayUrl = "skinmanager.voxelmodpack.com";
private static String skinUrl = "skins.voxelmodpack.com";
private static Cache<GameProfile, Map<Type, MinecraftProfileTexture>> skinsCache;
private static final Map<String, String> playerHashes = Maps.newHashMap();
private static final Map<String, Map<Type, MinecraftProfileTexture>> cachedTextures = Maps.newHashMap();
private static List<ISkinModifier> 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<ThreadDownloadImageData> e) { private String gatewayUrl = "skinmanager.voxelmodpack.com";
ThreadDownloadImageData imageDownload = e.getSource(); private String skinUrl = "skins.voxelmodpack.com";
if (imageDownload != null) { private boolean enabled = true;
String imageUrl = PrivateFields.imageUrl.get(imageDownload);
if (imageUrl != null) { private Map<GameProfile, ResourceLocation> skinCache = Maps.newHashMap();
if (imageUrl.contains("optifine.net")) private List<ISkinModifier> skinModifiers = Lists.newArrayList();
return; // ignore optifine capes
String hash = FilenameUtils.getBaseName(imageUrl); private HDSkinManager() {}
String uuid = resolvePlayerIdFromHash(hash);
if (uuid == null) { public static Optional<ResourceLocation> getSkin(final GameProfile profile) {
if (!(imageDownload instanceof PreviewTexture)) { return INSTANCE.getSkinLocation(profile);
return;
} }
uuid = Minecraft.getMinecraft().getSession().getPlayerID(); private Optional<ResourceLocation> 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);
}
});
return Optional.absent();
}
return skin == LOADING ? Optional.<ResourceLocation> absent() : Optional.of(skin);
} }
Map<Type, MinecraftProfileTexture> textures = getCachedTexturesForId(uuid); private void loadTexture(GameProfile profile, final Type type, final SkinAvailableCallback callback) {
MinecraftProfileTexture skinTexture = textures.get(Type.SKIN); if (profile != null && profile.getId() != null) {
if (skinTexture != null && skinTexture.getUrl().equals(imageUrl)) { String uuid = UUIDTypeAdapter.fromUUID(profile.getId());
Thread imageThread = PrivateFields.imageThread.get(imageDownload); String url = getCustomSkinURLForId(uuid, true);
if (imageThread != null) { // TODO use cache
HDSkinDownload hdThread = new HDSkinDownload(imageDownload, new ImageBufferDownloadHD(), final MinecraftProfileTexture texture = new MinecraftProfileTexture(url, null);
getCustomSkinURLForId(uuid, imageDownload instanceof PreviewTexture)); final ResourceLocation skin = new ResourceLocation("skins/" + texture.getHash());
PrivateFields.imageThread.set(imageDownload, hdThread); File file1 = new File(skinCacheDir, texture.getHash().substring(0, 2));
hdThread.setDaemon(true); @SuppressWarnings("unused")
hdThread.start(); File file2 = new File(file1, texture.getHash());
e.cancel(); final IImageBuffer imagebufferdownload = new ImageBufferDownloadHD();
} ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(null, url,
} else { DefaultPlayerSkin.getDefaultSkinLegacy(),
LiteLoaderLogger.debug("Not a skin texture!"); new IImageBuffer() {
} public BufferedImage parseUserSkin(BufferedImage image) {
} return imagebufferdownload.parseUserSkin(image);
}
} }
private static String resolvePlayerIdFromHash(String hash) { public void skinAvailable() {
Minecraft mc = Minecraft.getMinecraft(); imagebufferdownload.skinAvailable();
if (mc.theWorld == null) { if (callback != null) {
return null; callback.skinAvailable(type, skin, texture);
} }
return findPlayer(mc, hash); }
});
} Minecraft.getMinecraft().getTextureManager().loadTexture(skin, threaddownloadimagedata);
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<NetworkPlayerInfo> playersInfo = mc.getNetHandler().getPlayerInfoMap();
// players
for (NetworkPlayerInfo player : playersInfo) {
GameProfile profile = player.getGameProfile();
Map<Type, MinecraftProfileTexture> 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<EntityPlayer> players = world.playerEntities;
for (EntityPlayer player : players) {
GameProfile profile = player.getGameProfile();
Map<Type, MinecraftProfileTexture> 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<GameProfile, Map<Type, MinecraftProfileTexture>> e : getSkinsCache().asMap().entrySet()) {
GameProfile profile = e.getKey();
// stupid plugineers..
if (profile.getId() == null)
continue;
Map<Type, MinecraftProfileTexture> 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<?, MinecraftProfileTexture> 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<Type, MinecraftProfileTexture> 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);
} }
} }
private static Map<Type, MinecraftProfileTexture> getTexturesForProfile(GameProfile profile) { private static Map<Type, MinecraftProfileTexture> getTexturesForProfile(GameProfile profile) {
LiteLoaderLogger.debug("Get textures for " + profile.getId(), new Object[0]); LiteLoaderLogger.debug("Get textures for " + profile.getId(), new Object[0]);
Map<Type, MinecraftProfileTexture> cached = getCachedTexturesForId(trimUUID(profile.getId()));
if (cached != null) {
return cached;
}
Minecraft minecraft = Minecraft.getMinecraft(); Minecraft minecraft = Minecraft.getMinecraft();
MinecraftSessionService sessionService = minecraft.getSessionService(); MinecraftSessionService sessionService = minecraft.getSessionService();
Map<Type, MinecraftProfileTexture> textures = null; Map<Type, MinecraftProfileTexture> textures = null;
@ -187,56 +114,41 @@ public final class HDSkinManager {
&& profile.getId().equals(minecraft.getSession().getProfile().getId())) { && profile.getId().equals(minecraft.getSession().getProfile().getId())) {
textures = sessionService.getTextures(sessionService.fillProfileProperties(profile, false), false); textures = sessionService.getTextures(sessionService.fillProfileProperties(profile, false), false);
} }
storeTexturesForProfile(profile, textures);
return textures; return textures;
} }
private static Cache<GameProfile, Map<Type, MinecraftProfileTexture>> getSkinsCache() { public void setSkinUrl(String skinUrl) {
if (skinsCache == null) { this.skinUrl = skinUrl;
// final field isn't going to change
skinsCache = HDPrivateFields.skinCacheLoader.get(Minecraft.getMinecraft().getSkinManager());
}
return skinsCache;
} }
private static Map<Type, MinecraftProfileTexture> getCachedTexturesForId(String uuid) { public void setGatewayURL(String gatewayURL) {
return cachedTextures.get(uuid); this.gatewayUrl = gatewayURL;
} }
private static String trimUUID(UUID uuid) { public String getSkinUrl() {
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() {
return String.format("http://%s/", skinUrl); return String.format("http://%s/", skinUrl);
} }
public static String getGatewayUrl() { public String getGatewayUrl() {
return String.format("http://%s/", gatewayUrl); 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); uuid = StringUtils.stripControlCodes(uuid);
return String.format("http://%s/skins/%s.png", gateway ? gatewayUrl : skinUrl, 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)); 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) { public static PreviewTexture getPreviewTexture(ResourceLocation skinResource, GameProfile profile) {
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
Object skinTexture = textureManager.getTexture(skinResource); ITextureObject skinTexture = textureManager.getTexture(skinResource);
if (skinTexture == null) { if (skinTexture == null) {
Map<Type, MinecraftProfileTexture> textures = getTexturesForProfile(profile); Map<Type, MinecraftProfileTexture> textures = getTexturesForProfile(profile);
@ -244,7 +156,7 @@ public final class HDSkinManager {
if (skin != null) { if (skin != null) {
String url = skin.getUrl(); String url = skin.getUrl();
skinTexture = new PreviewTexture(url, DefaultPlayerSkin.getDefaultSkin(profile.getId()), new ImageBufferDownloadHD()); skinTexture = new PreviewTexture(url, DefaultPlayerSkin.getDefaultSkin(profile.getId()), new ImageBufferDownloadHD());
textureManager.loadTexture(skinResource, (ITextureObject) skinTexture); textureManager.loadTexture(skinResource, skinTexture);
} }
} }
return (PreviewTexture) skinTexture; return (PreviewTexture) skinTexture;
@ -259,17 +171,14 @@ public final class HDSkinManager {
} catch (IOException var1) { } catch (IOException var1) {
var1.printStackTrace(); 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); skinModifiers.add(modifier);
} }
static void updateSkin(BufferedImage image, Graphics dest) { public void convertSkin(BufferedImage image, Graphics dest) {
for (ISkinModifier skin : skinModifiers) { for (ISkinModifier skin : skinModifiers) {
skin.convertSkin(image, dest); skin.convertSkin(image, dest);
} }

View file

@ -0,0 +1,11 @@
package com.voxelmodpack.hdskins;
import net.minecraft.client.renderer.texture.SimpleTexture;
public class HDThreadImageDownload extends SimpleTexture {
public HDThreadImageDownload() {
super(null);
}
}

View file

@ -44,7 +44,7 @@ public class ImageBufferDownloadHD implements IImageBuffer {
drawImage(48, 52, 44, 64, 52, 20, 56, 32); drawImage(48, 52, 44, 64, 52, 20, 56, 32);
// mod things // mod things
HDSkinManager.updateSkin(image, graphics); HDSkinManager.INSTANCE.convertSkin(image, graphics);
graphics.dispose(); graphics.dispose();
return image; return image;

View file

@ -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);
}
}
}

View file

@ -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<Boolean> 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<ResourceLocation> ci) {
Optional<ResourceLocation> skin = HDSkinManager.getSkin(gameProfile);
if (skin.isPresent()) {
// set the skin
ci.setReturnValue(skin.get());
}
}
}

View file

@ -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<ResourceLocation> skin = HDSkinManager.getSkin(profile);
if (skin.isPresent())
// rebind
bindTexture(skin.get());
}
}
}

View file

@ -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}" ]
}
]
}

View file

@ -0,0 +1,9 @@
{
"package": "com.voxelmodpack.hdskins.mixin",
"refmap": "mixin.hdskins.refmap.json",
"mixins": [
"MixinImageBufferDownload",
"MixinPlayerInfo",
"MixinSkullRenderer"
]
}

View file

@ -83,13 +83,14 @@ public class MineLittlePony implements InitCompleteListener {
@Override @Override
public void onInitCompleted(Minecraft minecraft, LiteLoader loader) { public void onInitCompleted(Minecraft minecraft, LiteLoader loader) {
if (this.config.getHd().get()) {
HDSkinManager.clearSkinCache(); HDSkinManager.clearSkinCache();
HDSkinManager.setSkinUrl(SKIN_SERVER_URL); HDSkinManager manager = HDSkinManager.INSTANCE;
HDSkinManager.setGatewayURL(GATEWAY_URL); manager.setSkinUrl(config.skinfix ? GATEWAY_URL : SKIN_SERVER_URL);
HDSkinManager.addSkinModifier(new PonySkinModifier()); manager.setGatewayURL(GATEWAY_URL);
manager.addSkinModifier(new PonySkinModifier());
MineLPLogger.info("Set MineLP skin server URL."); MineLPLogger.info("Set MineLP skin server URL.");
}
RenderManager rm = minecraft.getRenderManager(); RenderManager rm = minecraft.getRenderManager();
ModUtilities.addRenderer(EntityPonyModel.class, new RenderPonyModel(rm)); ModUtilities.addRenderer(EntityPonyModel.class, new RenderPonyModel(rm));
if (this.config.getVillagers().get()) { if (this.config.getVillagers().get()) {
@ -127,6 +128,7 @@ public class MineLittlePony implements InitCompleteListener {
if (pressed || skins) { if (pressed || skins) {
minecraft.displayGuiScreen(new GuiSkinsMineLP(ponyManager)); minecraft.displayGuiScreen(new GuiSkinsMineLP(ponyManager));
} }
HDSkinManager.INSTANCE.setEnabled(config.getHd().get());
} }
public PonyManager getManager() { public PonyManager getManager() {

View file

@ -103,11 +103,7 @@ public class Pony {
return player.capabilities.isFlying || !(player.onGround || player.isOnLadder() || player.isInWater()); return player.capabilities.isFlying || !(player.onGround || player.isOnLadder() || player.isInWater());
} }
public PlayerModel getModel() { public PlayerModel getModel(boolean ignorePony, boolean smallArms) {
return getModel(false);
}
public PlayerModel getModel(boolean ignorePony) {
boolean is_a_pony = false; boolean is_a_pony = false;
switch (ignorePony ? PonyLevel.BOTH : config.getPonyLevel().get()) { switch (ignorePony ? PonyLevel.BOTH : config.getPonyLevel().get()) {
case HUMANS: case HUMANS:
@ -122,9 +118,9 @@ public class Pony {
PlayerModel model; PlayerModel model;
if (is_a_pony) { if (is_a_pony) {
model = PMAPI.pony; model = smallArms ? PMAPI.ponySmall : PMAPI.pony;
} else { } else {
model = PMAPI.human; model = smallArms ? PMAPI.humanSmall : PMAPI.human;
} }
return model; return model;
} }

View file

@ -31,6 +31,8 @@ public class PonyConfig implements AdvancedExposable {
private Value<Boolean> pigzombies = new Value<Boolean>(true); private Value<Boolean> pigzombies = new Value<Boolean>(true);
@Expose @Expose
private Value<Boolean> skeletons = new Value<Boolean>(true); private Value<Boolean> skeletons = new Value<Boolean>(true);
@Expose
public boolean skinfix = true;
public Value<PonyLevel> getPonyLevel() { public Value<PonyLevel> getPonyLevel() {
if (ponylevel.get() == null) if (ponylevel.get() == null)

View file

@ -21,7 +21,8 @@ public class RenderPonyModel extends RenderPlayerModel {
EntityPlayerModel playerModelEntity = (EntityPlayerModel) par1EntityLivingBase; EntityPlayerModel playerModelEntity = (EntityPlayerModel) par1EntityLivingBase;
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(this.getEntityTexture(playerModelEntity)); Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(this.getEntityTexture(playerModelEntity));
thePony.checkSkin(); thePony.checkSkin();
PlayerModel pm = thePony.getModel(true); // TODO small arms
PlayerModel pm = thePony.getModel(true, false);
this.mainModel = pm.getModel(); this.mainModel = pm.getModel();
pm.apply(thePony.metadata); pm.apply(thePony.metadata);
this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7);

View file

@ -4,6 +4,7 @@ import static net.minecraft.client.renderer.GlStateManager.scale;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; 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.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@ -34,6 +35,8 @@ import net.minecraft.util.ResourceLocation;
@Mixin(RenderPlayer.class) @Mixin(RenderPlayer.class)
public abstract class MixinRenderPlayer extends RendererLivingEntity implements IRenderPony { public abstract class MixinRenderPlayer extends RendererLivingEntity implements IRenderPony {
@Shadow
private boolean smallArms;
private PlayerModel playerModel; private PlayerModel playerModel;
private Pony thePony; private Pony thePony;
@ -41,9 +44,11 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements
super(renderManager, null, 0.5F); super(renderManager, null, 0.5F);
} }
@Inject(method="<init>(Lnet/minecraft/client/renderer/entity/RenderManager;Z)V", at=@At("RETURN")) @Inject(
method = "<init>(Lnet/minecraft/client/renderer/entity/RenderManager;Z)V",
at = @At("RETURN") )
private void init(RenderManager renderManager, boolean useSmallArms, CallbackInfo ci) { 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.mainModel = this.playerModel.getModel();
this.shadowSize = this.playerModel.getShadowsize(); this.shadowSize = this.playerModel.getShadowsize();
this.layerRenderers.clear(); this.layerRenderers.clear();
@ -77,7 +82,7 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements
this.playerModel.getModel().isFlying = thePony.isPegasusFlying(player); this.playerModel.getModel().isFlying = thePony.isPegasusFlying(player);
if (MineLittlePony.getConfig().getShowScale().get()) { if (MineLittlePony.getConfig().getShowScale().get()) {
if (this.playerModel != PMAPI.human) { if (this.playerModel.getModel().metadata.getRace() != null) {
PonySize size = thePony.metadata.getSize(); PonySize size = thePony.metadata.getSize();
if (size == PonySize.FOAL) if (size == PonySize.FOAL)
this.shadowSize = 0.25F; this.shadowSize = 0.25F;
@ -110,7 +115,7 @@ public abstract class MixinRenderPlayer extends RendererLivingEntity implements
this.playerModel.getModel().heldItemRight = 0; 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) { private void setupPlayerScale(AbstractClientPlayer player, double xPosition, double yPosition, double zPosition, CallbackInfo ci) {
if (MineLittlePony.getConfig().getShowScale().get() && !(playerModel.getModel() instanceof ModelHumanPlayer)) { 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) { private PlayerModel getModel(AbstractClientPlayer player) {
Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(player); ResourceLocation skin = getEntityTexture(player);
return thePony.getModel(); Pony thePony = MineLittlePony.getInstance().getManager().getPonyFromResourceRegistry(skin);
return thePony.getModel(false, this.smallArms);
} }
@Override @Override

View file

@ -6,8 +6,6 @@ import static net.minecraft.client.renderer.GlStateManager.translate;
import java.util.List; import java.util.List;
import com.brohoof.minelittlepony.MineLittlePony;
import com.brohoof.minelittlepony.Pony;
import com.brohoof.minelittlepony.PonyData; import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.model.part.IPonyPart; 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.brohoof.minelittlepony.renderer.PlaneRenderer;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@ -31,6 +27,12 @@ import net.minecraft.item.ItemStack;
public abstract class AbstractPonyModel extends ModelPlayer { public abstract class AbstractPonyModel extends ModelPlayer {
protected float scale = 0.0625F; protected float scale = 0.0625F;
public ModelRenderer steveLeftArm;
public ModelRenderer steveRightArm;
public ModelRenderer steveLeftArmwear;
public ModelRenderer steveRightArmwear;
public boolean isArmour = false; public boolean isArmour = false;
public boolean isVillager; public boolean isVillager;
public boolean isFlying; public boolean isFlying;
@ -40,8 +42,12 @@ public abstract class AbstractPonyModel extends ModelPlayer {
protected List<IPonyPart> modelParts = Lists.newArrayList(); protected List<IPonyPart> modelParts = Lists.newArrayList();
public AbstractPonyModel() { public AbstractPonyModel(boolean arms) {
super(0, false); 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) { public final void init(float yOffset, float stretch) {
@ -85,44 +91,15 @@ public abstract class AbstractPonyModel extends ModelPlayer {
} }
@Override @Override
public final void renderRightArm() { public void renderRightArm() {
// Use the human model this.steveRightArm.render(0.0625F);
PMAPI.human.getModel().renderModelRightArm(); this.steveRightArmwear.render(0.0625F);
} }
@Override @Override
public final void renderLeftArm() { public void renderLeftArm() {
// Use the human model this.steveLeftArm.render(0.0625f);
PMAPI.human.getModel().renderModelLeftArm(); this.steveLeftArmwear.render(0.0625f);
}
@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);
} }
protected void setModelVisibilities(AbstractClientPlayer clientPlayer) { protected void setModelVisibilities(AbstractClientPlayer clientPlayer) {

View file

@ -14,11 +14,13 @@ import com.brohoof.minelittlepony.model.pony.armor.ZombiePonyArmors;
public final class PMAPI { 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 zombie = new PlayerModel(new ModelZombiePony()).setArmor(new ZombiePonyArmors());
public static final PlayerModel skeleton = new PlayerModel(new ModelSkeletonPony()).setArmor(new SkeletonPonyArmors()); 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 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() { public static void init() {
for (Field field : PMAPI.class.getFields()) { for (Field field : PMAPI.class.getFields()) {

View file

@ -9,6 +9,10 @@ public class ModelHumanPlayer extends AbstractPonyModel {
public ModelRenderer bipedEars; public ModelRenderer bipedEars;
public ModelRenderer cloak; public ModelRenderer cloak;
public ModelHumanPlayer(boolean smallArms) {
super(smallArms);
}
@Override @Override
protected boolean doCancelRender() { protected boolean doCancelRender() {
return true; return true;

View file

@ -24,17 +24,19 @@ import net.minecraft.util.MathHelper;
public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConstants { public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConstants {
private final boolean smallArms;
public boolean rainboom; public boolean rainboom;
public ModelRenderer bipedCape; public ModelRenderer bipedCape;
public PlaneRenderer[] Bodypiece; public PlaneRenderer[] Bodypiece;
public PlaneRenderer[] BodypieceNeck; public PlaneRenderer[] BodypieceNeck;
public ModelRenderer SteveArm;
public ModelRenderer unicornarm; public ModelRenderer unicornarm;
public PlaneRenderer[] Tail; public PlaneRenderer[] Tail;
public ModelPlayerPony() { public ModelPlayerPony(boolean smallArms) {
super(smallArms);
this.smallArms = smallArms;
addParts(); addParts();
} }
@ -62,7 +64,6 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.Bodypiece[k1].rotateAngleY = bodySwingRotation * 0.2F; this.Bodypiece[k1].rotateAngleY = bodySwingRotation * 0.2F;
} }
for (k1 = 0; k1 < this.BodypieceNeck.length; ++k1) { for (k1 = 0; k1 < this.BodypieceNeck.length; ++k1) {
this.BodypieceNeck[k1].rotateAngleY = bodySwingRotation * 0.2F; this.BodypieceNeck[k1].rotateAngleY = bodySwingRotation * 0.2F;
} }
@ -193,7 +194,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F); leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
} }
this.SteveArm.rotateAngleY = 0.2F; this.steveRightArm.rotateAngleY = 0.2F;
this.bipedRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.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; leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 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; 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.unicornarm.rotateAngleY = 0.0F;
this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F;
@ -219,7 +220,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.SteveArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornarm.rotateAngleX = 0.0F; this.unicornarm.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
@ -227,7 +228,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.SteveArm.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornarm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F;
this.bipedLeftArm.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 cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
float legOutset = 4.0F; float legOutset = 4.0F;
if (this.isSneak && !this.isFlying) { if (this.isSneak && !this.isFlying) {
legOutset = 0.0F; legOutset = smallArms ? 1.0F : 0F;
} }
if (this.isSleeping) { if (this.isSleeping) {
@ -246,17 +247,17 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
if (this.rainboom) { if (this.rainboom) {
this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F; 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; this.bipedLeftArm.rotationPointZ = 0.0F - sinBodyRotateAngleYFactor + 2.0F;
} else { } else {
this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F; 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.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.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.bipedRightLeg.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset;
this.bipedLeftLeg.rotationPointX = 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() { protected void holdItem() {
if (this.heldItemRight != 0 && !this.rainboom && (!this.metadata.getRace().hasHorn() || this.metadata.getGlowColor() == 0)) { 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.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.rotateAngleX = (float) (this.bipedRightArm.rotateAngleX - (f22 * 1.2D + f33));
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
this.bipedRightArm.rotateAngleZ = f28 * -0.4F; this.bipedRightArm.rotateAngleZ = f28 * -0.4F;
this.SteveArm.rotateAngleX = (float) (this.SteveArm.rotateAngleX - (f22 * 1.2D + f33)); this.steveRightArm.rotateAngleX = (float) (this.steveRightArm.rotateAngleX - (f22 * 1.2D + f33));
this.SteveArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; this.steveRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
this.SteveArm.rotateAngleZ = f28 * -0.4F; this.steveRightArm.rotateAngleZ = f28 * -0.4F;
} }
} }
@ -341,8 +342,8 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
} else { } else {
this.bipedRightArm.rotateAngleZ += cosTickFactor; this.bipedRightArm.rotateAngleZ += cosTickFactor;
this.bipedRightArm.rotateAngleX += sinTickFactor; this.bipedRightArm.rotateAngleX += sinTickFactor;
this.SteveArm.rotateAngleZ += cosTickFactor; this.steveRightArm.rotateAngleZ += cosTickFactor;
this.SteveArm.rotateAngleX += sinTickFactor; this.steveRightArm.rotateAngleX += sinTickFactor;
} }
} }
@ -376,7 +377,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
} }
protected void sneakLegs() { 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.unicornarm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.bipedRightArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.bipedRightArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT;
@ -713,7 +714,6 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.bipedRightArm = new ModelRenderer(this, 40, 16); this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightLeg = new ModelRenderer(this, 0, 16); this.bipedRightLeg = new ModelRenderer(this, 0, 16);
if (this.textureHeight == 64) {
this.bipedLeftArm = new ModelRenderer(this, 32, 48); this.bipedLeftArm = new ModelRenderer(this, 32, 48);
this.bipedLeftLeg = new ModelRenderer(this, 16, 48); this.bipedLeftLeg = new ModelRenderer(this, 16, 48);
@ -722,15 +722,10 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
this.bipedLeftArmwear = new ModelRenderer(this, 48, 48); this.bipedLeftArmwear = new ModelRenderer(this, 48, 48);
this.bipedLeftLegwear = new ModelRenderer(this, 0, 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.unicornarm = new ModelRenderer(this, 40, 32).setTextureSize(64, 64);
this.boxList.remove(this.SteveArm);
this.boxList.remove(this.steveRightArm);
this.boxList.remove(this.unicornarm); this.boxList.remove(this.unicornarm);
} }
@ -824,6 +819,20 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
} }
protected void initLegPositions(float yOffset, float stretch) { protected void initLegPositions(float yOffset, float stretch) {
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.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); this.bipedRightArm.setRotationPoint(-3.0F, 8.0F + yOffset, 0.0F);
if (bipedRightArmwear != null) { if (bipedRightArmwear != null) {
@ -836,6 +845,7 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
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.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.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.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); 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) { 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.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.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); this.unicornarm.setRotationPoint(-5.0F, 2.0F + yOffset, 0.0F);
} }

View file

@ -9,6 +9,10 @@ import net.minecraft.util.MathHelper;
public class ModelSkeletonPony extends ModelPlayerPony { public class ModelSkeletonPony extends ModelPlayerPony {
public ModelSkeletonPony() {
super(false);
}
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
@ -31,7 +35,7 @@ public class ModelSkeletonPony extends ModelPlayerPony {
} }
this.bipedRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F;
this.SteveArm.rotateAngleY = 0.2F; this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.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; rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F;
this.SteveArm.rotateAngleY = 0.0F; this.steveRightArm.rotateAngleY = 0.0F;
this.unicornarm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F;
@ -58,13 +62,13 @@ public class ModelSkeletonPony extends ModelPlayerPony {
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.SteveArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornarm.rotateAngleX = rightArmRotateAngleX; this.unicornarm.rotateAngleX = rightArmRotateAngleX;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.SteveArm.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornarm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.heldItemRight != 0) { if (this.heldItemRight != 0) {

View file

@ -13,6 +13,10 @@ public class ModelVillagerPony extends ModelPlayerPony {
public int profession; public int profession;
public ModelVillagerPony() {
super(false);
}
@Override @Override
public void animate(AniParams aniparams) { public void animate(AniParams aniparams) {
super.animate(aniparams); super.animate(aniparams);

View file

@ -6,6 +6,10 @@ import net.minecraft.util.MathHelper;
public class ModelZombiePony extends ModelPlayerPony { public class ModelZombiePony extends ModelPlayerPony {
public ModelZombiePony() {
super(false);
}
@Override @Override
protected void rotateLegs(float move, float swing, float tick) { protected void rotateLegs(float move, float swing, float tick) {
float rightArmRotateAngleX; float rightArmRotateAngleX;
@ -29,7 +33,7 @@ public class ModelZombiePony extends ModelPlayerPony {
} }
this.bipedRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F;
this.SteveArm.rotateAngleY = 0.2F; this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.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; rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F;
this.SteveArm.rotateAngleY = 0.0F; this.steveRightArm.rotateAngleY = 0.0F;
this.unicornarm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F;
@ -56,13 +60,13 @@ public class ModelZombiePony extends ModelPlayerPony {
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.SteveArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornarm.rotateAngleX = 0.0F; this.unicornarm.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.SteveArm.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornarm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.heldItemRight == 0) { if (this.heldItemRight == 0) {

View file

@ -6,8 +6,8 @@ import com.brohoof.minelittlepony.model.pony.ModelHumanPlayer;
public class HumanArmors extends AbstractArmor { public class HumanArmors extends AbstractArmor {
public HumanArmors() { public HumanArmors() {
this.modelArmorChestplate = new ModelHumanPlayer(); this.modelArmorChestplate = new ModelHumanPlayer(false);
this.modelArmor = new ModelHumanPlayer(); this.modelArmor = new ModelHumanPlayer(false);
} }
} }

View file

@ -16,6 +16,7 @@ public class ModelPonyArmor extends ModelPlayerPony {
public ModelRenderer[] extLegs; public ModelRenderer[] extLegs;
public ModelPonyArmor() { public ModelPonyArmor() {
super(false);
this.isArmour = true; this.isArmour = true;
this.textureHeight = 32; this.textureHeight = 32;
} }
@ -194,7 +195,7 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.bipedRightLeg = new ModelRenderer(this, 0, 16); this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16); this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true; 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.unicornarm = new ModelRenderer(this, 0, 16);
this.extLegs[0] = new ModelRenderer(this, 48, 8); this.extLegs[0] = new ModelRenderer(this, 48, 8);
this.extLegs[1] = new ModelRenderer(this, 48, 8); this.extLegs[1] = new ModelRenderer(this, 48, 8);

View file

@ -28,7 +28,7 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor {
} }
this.bipedRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F;
this.SteveArm.rotateAngleY = 0.2F; this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.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; rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F;
this.SteveArm.rotateAngleY = 0.0F; this.steveRightArm.rotateAngleY = 0.0F;
this.unicornarm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F;
@ -51,13 +51,13 @@ public class ModelSkeletonPonyArmor extends ModelPonyArmor {
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.SteveArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornarm.rotateAngleX = 0.0F; this.unicornarm.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.SteveArm.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornarm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.heldItemRight != 0) { if (this.heldItemRight != 0) {

View file

@ -28,7 +28,7 @@ public class ModelZombiePonyArmor extends ModelPonyArmor {
} }
this.bipedRightArm.rotateAngleY = 0.2F; this.bipedRightArm.rotateAngleY = 0.2F;
this.SteveArm.rotateAngleY = 0.2F; this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F; this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F; this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.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; rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing; leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleY = 0.0F;
this.SteveArm.rotateAngleY = 0.0F; this.steveRightArm.rotateAngleY = 0.0F;
this.unicornarm.rotateAngleY = 0.0F; this.unicornarm.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F; this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedRightLeg.rotateAngleY = 0.0F;
@ -51,13 +51,13 @@ public class ModelZombiePonyArmor extends ModelPonyArmor {
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.SteveArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornarm.rotateAngleX = 0.0F; this.unicornarm.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.SteveArm.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornarm.rotateAngleZ = 0.0F; this.unicornarm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.heldItemRight == 0) { if (this.heldItemRight == 0) {

View file

@ -6,7 +6,6 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14; import org.lwjgl.opengl.GL14;
import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.model.PMAPI;
import com.brohoof.minelittlepony.model.PlayerModel; import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.model.pony.ModelPlayerPony; import com.brohoof.minelittlepony.model.pony.ModelPlayerPony;
import com.brohoof.minelittlepony.renderer.IRenderPony; 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_, 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) { float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
PlayerModel pony = ((IRenderPony) livingPonyEntity).getPony(); 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_, held.doRenderLayer(entity, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_,
p_177141_7_, scale); p_177141_7_, scale);
return; return;

View file

@ -3,7 +3,6 @@ package com.brohoof.minelittlepony.renderer.layer;
import static net.minecraft.client.renderer.GlStateManager.*; import static net.minecraft.client.renderer.GlStateManager.*;
import com.brohoof.minelittlepony.PonySize; import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.model.PMAPI;
import com.brohoof.minelittlepony.model.PlayerModel; import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.renderer.IRenderPony; 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, public void doRenderLayer(AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6,
float p7, float scale) { float p7, float scale) {
PlayerModel model = ((IRenderPony) renderer).getPony(); 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); cape.doRenderLayer(clientPlayer, p2, p3, ticks, p5, p6, p7, scale);
} else if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible() } else if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible()
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null) { && clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null) {

View file

@ -7,7 +7,7 @@ minelp.options.ponylevel.ponies=Ponies Only
minelp.options.ponylevel.humans=Humans Only minelp.options.ponylevel.humans=Humans Only
minelp.options.ponylevel.both=Both minelp.options.ponylevel.both=Both
minelp.options.options=Pony Options 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.sizes=Allow all different sizes of pony
minelp.options.snuzzles=Display snuzzles on ponies minelp.options.snuzzles=Display snuzzles on ponies
minelp.options.showscale=Use show-accurate scaling minelp.options.showscale=Use show-accurate scaling

View file

@ -9,7 +9,7 @@ minelp.options.ponylevel.ponies=Seuls Poneys
minelp.options.ponylevel.humans=Seuls Humains minelp.options.ponylevel.humans=Seuls Humains
minelp.options.ponylevel.both=Deux minelp.options.ponylevel.both=Deux
minelp.options.options=Options Poney 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.sizes=Autoriser tous les différentes tailles de poney
minelp.options.ponyarmor=Utiliser armure compatible de MineLP minelp.options.ponyarmor=Utiliser armure compatible de MineLP
minelp.options.snuzzles=Afficher museau sur les poneys minelp.options.snuzzles=Afficher museau sur les poneys

View file

@ -6,7 +6,7 @@ minelp.options.ponylevel.ponies=Только пони
minelp.options.ponylevel.humans=Только люди minelp.options.ponylevel.humans=Только люди
minelp.options.ponylevel.both=И то и другое minelp.options.ponylevel.both=И то и другое
minelp.options.options=Опции minelp.options.options=Опции
minelp.options.hd=Включить Mine Little Pony скин-сервер (требуется перезапуск) minelp.options.hd=Включить Mine Little Pony скин-сервер
minelp.options.sizes=Разрешить пони разных размеров и расс minelp.options.sizes=Разрешить пони разных размеров и расс
minelp.options.ponyarmor=Использовать текстуры брони совместимые с модом minelp.options.ponyarmor=Использовать текстуры брони совместимые с модом
minelp.options.snuzzles=Показывать объёмные носы minelp.options.snuzzles=Показывать объёмные носы