use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.
the class PaintingHelper method getLocalPlayersHairColour.
@SideOnly(Side.CLIENT)
public static int getLocalPlayersHairColour() {
PlayerPointer playerPointer = new PlayerPointer(Minecraft.getMinecraft().thePlayer);
EquipmentWardrobeData ewd = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(playerPointer);
if (ewd != null) {
return ewd.hairColour;
}
return Color.decode("#804020").getRGB();
}
use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method getPlayerExtraColours.
public byte[] getPlayerExtraColours(Entity entity) {
if (!(entity instanceof AbstractClientPlayer)) {
return null;
}
AbstractClientPlayer player = (AbstractClientPlayer) entity;
EntityEquipmentData equipmentData = playerEquipmentMap.get(new PlayerPointer(player));
return null;
}
use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.
the class EquipmentRenderHandler method isArmourRenderOverridden.
@Override
public boolean isArmourRenderOverridden(EntityPlayer player, int slotId) {
if (slotId < 4 & slotId >= 0) {
return false;
}
if (player == null) {
return false;
}
EquipmentWardrobeHandler ewh = ClientProxy.equipmentWardrobeHandler;
EquipmentWardrobeData ewd = ewh.getEquipmentWardrobeData(new PlayerPointer(player));
if (ewd != null) {
return ewd.armourOverride.get(slotId);
}
return false;
}
use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.
the class EquipmentWardrobeHandler method onRender.
@SubscribeEvent
public void onRender(RenderPlayerEvent.Post event) {
EntityPlayer player = event.entityPlayer;
if (player instanceof MannequinFakePlayer) {
return;
}
if (player.getGameProfile() == null) {
return;
}
if (player instanceof FakePlayer) {
return;
}
// Restore the head overlay.
PlayerPointer playerPointer = new PlayerPointer(player);
RenderPlayer renderer = event.renderer;
if (equipmentWardrobeMap.containsKey(playerPointer)) {
renderer.modelBipedMain.bipedHeadwear.isHidden = false;
}
}
use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.
the class EquipmentWardrobeHandler method onRender.
@SubscribeEvent(priority = EventPriority.HIGH)
public void onRender(RenderPlayerEvent.SetArmorModel event) {
int slot = -event.slot + 3;
if (slot > 3) {
return;
}
EntityPlayer player = event.entityPlayer;
if (player instanceof MannequinFakePlayer) {
return;
}
if (player.getGameProfile() == null) {
return;
}
if (player instanceof FakePlayer) {
return;
}
int result = -1;
// Hide the armour if it had been skinned.
ItemStack stack = player.getCurrentArmor(event.slot);
if (SkinNBTHelper.stackHasSkinData(stack)) {
result = -2;
}
// Hide the armour if the player has turned it off.
PlayerPointer playerPointer = new PlayerPointer(player);
if (equipmentWardrobeMap.containsKey(playerPointer)) {
EquipmentWardrobeData ewd = equipmentWardrobeMap.get(playerPointer);
if (ewd.armourOverride.get(slot)) {
result = -2;
}
}
event.result = result;
}
Aggregations