MineLittlePony/src/main/java/com/minelittlepony/hdskins/gui/GuiSkinsMineLP.java

60 lines
2.1 KiB
Java
Raw Normal View History

2016-11-16 23:45:04 -05:00
package com.minelittlepony.hdskins.gui;
2015-08-01 18:36:33 -04:00
import java.awt.image.BufferedImage;
2015-08-11 14:30:38 -04:00
2016-11-16 23:45:04 -05:00
import com.minelittlepony.MineLittlePony;
import com.minelittlepony.PonyGender;
import com.minelittlepony.PonyManager;
import com.minelittlepony.PonyRace;
import com.minelittlepony.PonySize;
import com.minelittlepony.TailLengths;
import com.minelittlepony.util.MineLPLogger;
2015-08-01 18:36:33 -04:00
import com.mojang.authlib.GameProfile;
import com.voxelmodpack.hdskins.gui.EntityPlayerModel;
import com.voxelmodpack.hdskins.gui.GuiSkins;
import com.voxelmodpack.hdskins.gui.GuiMetaHandler;
2015-08-01 18:36:33 -04:00
public class GuiSkinsMineLP extends GuiSkins {
2015-08-01 18:36:33 -04:00
private PonyManager ponyManager;
public GuiSkinsMineLP(PonyManager manager) {
this.ponyManager = manager;
}
@Override
protected void setupMetaOverrides(GuiMetaHandler meta) {
super.setupMetaOverrides(meta);
meta.selection(MineLittlePony.MLP_RACE, PonyRace.class);
meta.selection(MineLittlePony.MLP_TAIL, TailLengths.class);
meta.selection(MineLittlePony.MLP_GENDER, PonyGender.class);
meta.selection(MineLittlePony.MLP_SIZE, PonySize.class);
meta.color(MineLittlePony.MLP_MAGIC);
}
2015-08-01 18:36:33 -04:00
@Override
protected EntityPlayerModel getModel(GameProfile profile) {
return new EntityPonyModel(profile);
2015-08-01 18:36:33 -04:00
}
@Override
protected void onSetLocalSkin(BufferedImage skin) {
MineLPLogger.debug("Invalidating old local skin, checking updated local skin");
ponyManager.getPonyFromResourceRegistry(this.localPlayer.getSkinTexture()).checkSkin(skin);
2015-08-01 18:36:33 -04:00
}
@Override
protected void onSetRemoteSkin() {
MineLPLogger.debug("Invalidating old remove skin, checking updated remote skin");
ponyManager.getPonyFromResourceRegistry(this.remotePlayer.getSkinTexture()).invalidateSkinCheck();
2015-08-01 18:36:33 -04:00
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
ponyManager.getPonyFromResourceRegistry(this.localPlayer.getSkinTexture()).invalidateSkinCheck();
ponyManager.getPonyFromResourceRegistry(this.remotePlayer.getSkinTexture()).invalidateSkinCheck();
2015-08-11 14:30:38 -04:00
}
2015-08-01 18:36:33 -04:00
}