Update for the latest changes to HDSkins

This commit is contained in:
Sollace 2019-03-27 09:46:24 +02:00
parent b3c21cd47d
commit 00d45b30c3
6 changed files with 20 additions and 18 deletions

View file

@ -6,10 +6,10 @@ import com.minelittlepony.client.gui.hdskins.GuiSkinsMineLP;
import com.minelittlepony.client.pony.PonyManager; import com.minelittlepony.client.pony.PonyManager;
import com.minelittlepony.client.render.tileentities.skull.PonySkullRenderer; import com.minelittlepony.client.render.tileentities.skull.PonySkullRenderer;
import com.minelittlepony.common.client.gui.GuiHost; import com.minelittlepony.common.client.gui.GuiHost;
import com.minelittlepony.hdskins.HDSkinManager; import com.minelittlepony.hdskins.HDSkins;
import com.minelittlepony.hdskins.server.LegacySkinServer; import com.minelittlepony.hdskins.net.LegacySkinServer;
import com.minelittlepony.hdskins.server.SkinServer; import com.minelittlepony.hdskins.net.SkinServer;
import com.minelittlepony.hdskins.server.ValhallaSkinServer; import com.minelittlepony.hdskins.net.ValhallaSkinServer;
import com.minelittlepony.settings.PonyConfig; import com.minelittlepony.settings.PonyConfig;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -71,7 +71,7 @@ public class MineLPClient extends MineLittlePony {
*/ */
void postInit(Minecraft minecraft) { void postInit(Minecraft minecraft) {
HDSkinManager manager = HDSkinManager.INSTANCE; HDSkins manager = HDSkins.getInstance();
// manager.setSkinUrl(SKIN_SERVER_URL); // manager.setSkinUrl(SKIN_SERVER_URL);
// manager.setGatewayURL(GATEWAY_URL); // manager.setGatewayURL(GATEWAY_URL);
manager.addSkinModifier(new PonySkinModifier()); manager.addSkinModifier(new PonySkinModifier());

View file

@ -8,17 +8,19 @@ public class PonySkinModifier implements ISkinModifier {
public void convertSkin(ISkinModifier.IDrawer drawer) { public void convertSkin(ISkinModifier.IDrawer drawer) {
int scale = drawer.getImage().getWidth() / 64; int scale = drawer.getImage().getWidth() / 64;
// TODO: What are these numbers!?
//top, mirror //top, mirror
drawer.draw(scale, 60, 32, 58, 34, 58, 16, 60, 18); // drawer.draw(scale, 60, 32, 58, 34, 58, 16, 60, 18, false, false);
//bottom, mirror //bottom, mirror
drawer.draw(scale, 62, 32, 60, 34, 60, 16, 62, 18); // drawer.draw(scale, 62, 32, 60, 34, 60, 16, 62, 18, false, false);
//inside //inside
drawer.draw(scale, 58, 34, 56, 48, 60, 18, 62, 32); // drawer.draw(scale, 58, 34, 56, 48, 60, 18, 62, 32, false, false);
//back //back
drawer.draw(scale, 60, 34, 58, 48, 58, 18, 60, 32); // drawer.draw(scale, 60, 34, 58, 48, 58, 18, 60, 32, false, false);
//outside //outside
drawer.draw(scale, 62, 34, 60, 48, 56, 18, 58, 32); // drawer.draw(scale, 62, 34, 60, 48, 56, 18, 58, 32, false, false);
//back //back
drawer.draw(scale, 64, 34, 62, 48, 62, 18, 64, 32); // drawer.draw(scale, 64, 34, 62, 48, 62, 18, 64, 32, false, false);
} }
} }

View file

@ -5,7 +5,7 @@ import com.minelittlepony.common.client.gui.IconicToggle;
import com.minelittlepony.common.client.gui.Style; import com.minelittlepony.common.client.gui.Style;
import com.minelittlepony.hdskins.gui.EntityPlayerModel; import com.minelittlepony.hdskins.gui.EntityPlayerModel;
import com.minelittlepony.hdskins.gui.GuiSkins; import com.minelittlepony.hdskins.gui.GuiSkins;
import com.minelittlepony.hdskins.server.SkinServer; import com.minelittlepony.hdskins.net.SkinServer;
import com.minelittlepony.pony.IPonyManager; import com.minelittlepony.pony.IPonyManager;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTexture;

View file

@ -9,7 +9,7 @@ import com.minelittlepony.client.render.layer.LayerHeldPonyItemMagical;
import com.minelittlepony.client.render.layer.LayerPonyArmor; import com.minelittlepony.client.render.layer.LayerPonyArmor;
import com.minelittlepony.client.render.layer.LayerPonyCustomHead; import com.minelittlepony.client.render.layer.LayerPonyCustomHead;
import com.minelittlepony.client.render.layer.LayerPonyElytra; import com.minelittlepony.client.render.layer.LayerPonyElytra;
import com.minelittlepony.hdskins.HDSkinManager; import com.minelittlepony.hdskins.HDSkins;
import com.minelittlepony.pony.IPony; import com.minelittlepony.pony.IPony;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -105,7 +105,7 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
@Override @Override
@Nonnull @Nonnull
protected final ResourceLocation getEntityTexture(T entity) { protected final ResourceLocation getEntityTexture(T entity) {
return HDSkinManager.INSTANCE.getConvertedSkin(getTexture(entity)); return HDSkins.getInstance().getConvertedSkin(getTexture(entity));
} }
@Override @Override

View file

@ -3,7 +3,7 @@ package com.minelittlepony.client.render.tileentities.skull;
import com.minelittlepony.client.model.components.ModelDeadMau5Ears; import com.minelittlepony.client.model.components.ModelDeadMau5Ears;
import com.minelittlepony.client.pony.Pony; import com.minelittlepony.client.pony.Pony;
import com.minelittlepony.client.render.RenderPony; import com.minelittlepony.client.render.RenderPony;
import com.minelittlepony.hdskins.HDSkinManager; import com.minelittlepony.hdskins.HDSkins;
import com.minelittlepony.settings.PonyConfig; import com.minelittlepony.settings.PonyConfig;
import com.minelittlepony.settings.PonyLevel; import com.minelittlepony.settings.PonyLevel;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
@ -43,7 +43,7 @@ public class PlayerSkullRenderer extends PonySkull {
deadMau5.setVisible(profile != null && "deadmau5".equals(profile.getName())); deadMau5.setVisible(profile != null && "deadmau5".equals(profile.getName()));
if (profile != null) { if (profile != null) {
ResourceLocation skin = HDSkinManager.INSTANCE.getTextures(profile).get(Type.SKIN); ResourceLocation skin = HDSkins.getInstance().getTextures(profile).get(Type.SKIN);
if (skin != null && Pony.getBufferedImage(skin) != null) { if (skin != null && Pony.getBufferedImage(skin) != null) {
return skin; return skin;
} }

View file

@ -1,6 +1,6 @@
package com.minelittlepony.client.settings; package com.minelittlepony.client.settings;
import com.minelittlepony.hdskins.HDSkinManager; import com.minelittlepony.hdskins.HDSkins;
import com.minelittlepony.settings.PonyConfig; import com.minelittlepony.settings.PonyConfig;
import com.minelittlepony.settings.PonyLevel; import com.minelittlepony.settings.PonyLevel;
@ -10,7 +10,7 @@ public abstract class ClientPonyConfig extends PonyConfig {
public void setPonyLevel(PonyLevel ponylevel) { public void setPonyLevel(PonyLevel ponylevel) {
// only trigger reloads when the value actually changes // only trigger reloads when the value actually changes
if (ponylevel != getPonyLevel()) { if (ponylevel != getPonyLevel()) {
HDSkinManager.INSTANCE.parseSkins(); HDSkins.getInstance().parseSkins();
} }
super.setPonyLevel(ponylevel); super.setPonyLevel(ponylevel);