2016-11-16 23:45:04 -05:00
|
|
|
package com.minelittlepony.hdskins.gui;
|
2015-08-01 18:36:33 -04:00
|
|
|
|
2016-11-24 23:40:19 -05:00
|
|
|
import com.minelittlepony.MineLittlePony;
|
2016-11-16 23:45:04 -05:00
|
|
|
import com.minelittlepony.PonyManager;
|
2015-08-01 18:36:33 -04:00
|
|
|
import com.mojang.authlib.GameProfile;
|
2016-12-21 01:20:02 -05:00
|
|
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
2018-05-01 12:38:13 +02:00
|
|
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
2015-08-01 18:36:33 -04:00
|
|
|
import com.voxelmodpack.hdskins.gui.EntityPlayerModel;
|
2015-08-12 20:03:54 -04:00
|
|
|
import com.voxelmodpack.hdskins.gui.GuiSkins;
|
2017-06-16 01:41:36 -04:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2015-08-01 18:36:33 -04:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Skin uploading GUI. Usually displayed over the main menu.
|
|
|
|
*/
|
2015-08-12 20:03:54 -04:00
|
|
|
public class GuiSkinsMineLP extends GuiSkins {
|
2015-08-01 18:36:33 -04:00
|
|
|
|
2018-06-10 18:54:50 +02:00
|
|
|
private PonyManager ponyManager = MineLittlePony.getInstance().getManager();
|
2016-05-18 05:48:46 -04:00
|
|
|
|
2015-08-01 18:36:33 -04:00
|
|
|
@Override
|
2015-08-12 20:03:54 -04:00
|
|
|
protected EntityPlayerModel getModel(GameProfile profile) {
|
|
|
|
return new EntityPonyModel(profile);
|
2015-08-01 18:36:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-05-01 12:38:13 +02:00
|
|
|
protected void onSetLocalSkin(Type type) {
|
2016-11-24 23:40:19 -05:00
|
|
|
MineLittlePony.logger.debug("Invalidating old local skin, checking updated local skin");
|
2018-05-01 12:38:13 +02:00
|
|
|
if (type == Type.SKIN) {
|
2018-04-27 13:49:33 +02:00
|
|
|
ponyManager.removePony(localPlayer.getSkinTexture());
|
2017-06-16 01:41:36 -04:00
|
|
|
}
|
2015-08-01 18:36:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-05-01 12:38:13 +02:00
|
|
|
protected void onSetRemoteSkin(Type type, ResourceLocation resource, MinecraftProfileTexture profileTexture) {
|
2016-12-21 01:20:02 -05:00
|
|
|
MineLittlePony.logger.debug("Invalidating old remote skin, checking updated remote skin");
|
2018-05-01 12:38:13 +02:00
|
|
|
if (type == Type.SKIN) {
|
|
|
|
ponyManager.removePony(resource);
|
2017-06-16 01:41:36 -04:00
|
|
|
}
|
2015-08-01 18:36:33 -04:00
|
|
|
}
|
|
|
|
}
|