use of net.minecraft.client.renderer.entity.RenderPlayer in project RebornCore by TechReborn.
the class HolidayRenderEvent method holidayRender.
@SubscribeEvent
public static void holidayRender(RenderPlayerEvent.Pre event) {
if (!CalenderUtils.christmas || !RebornCoreConfig.easterEggs) {
return;
}
Render render = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(event.getEntityPlayer());
if (render instanceof RenderPlayer) {
RenderPlayer renderPlayer = (RenderPlayer) render;
if (!renderPlayerList.contains(renderPlayer)) {
renderPlayer.addLayer(new LayerRender());
renderPlayerList.add(renderPlayer);
}
}
}
use of net.minecraft.client.renderer.entity.RenderPlayer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method onRenderSpecialsPost.
@SubscribeEvent
public void onRenderSpecialsPost(RenderPlayerEvent.Specials.Post event) {
if (ClientProxy.getSkinRenderType() != SkinRenderType.RENDER_EVENT) {
return;
}
EntityPlayer player = event.entityPlayer;
RenderPlayer render = event.renderer;
if (player.getGameProfile() == null) {
return;
}
PlayerPointer playerPointer = new PlayerPointer(player);
if (!playerEquipmentMap.containsKey(playerPointer)) {
return;
}
double distance = Minecraft.getMinecraft().thePlayer.getDistance(player.posX, player.posY, player.posZ);
if (distance > ConfigHandlerClient.maxSkinRenderDistance) {
return;
}
EquipmentWardrobeData ewd = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(new PlayerPointer(player));
byte[] extraColours = null;
if (ewd != null) {
Color skinColour = new Color(ewd.skinColour);
Color hairColour = new Color(ewd.hairColour);
extraColours = new byte[] { (byte) skinColour.getRed(), (byte) skinColour.getGreen(), (byte) skinColour.getBlue(), (byte) hairColour.getRed(), (byte) hairColour.getGreen(), (byte) hairColour.getBlue() };
}
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_BLEND);
for (int slot = 0; slot < 4; slot++) {
for (int skinIndex = 0; skinIndex < ExPropsPlayerSkinData.MAX_SLOTS_PER_SKIN_TYPE; skinIndex++) {
if (slot == SkinTypeRegistry.skinHead.getVanillaArmourSlotId()) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinHead, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinHead, skinIndex);
if (data != null) {
customHead.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
if (slot == SkinTypeRegistry.skinChest.getVanillaArmourSlotId()) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinChest, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinChest, skinIndex);
if (data != null) {
customChest.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
if (slot == SkinTypeRegistry.skinLegs.getVanillaArmourSlotId()) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinLegs, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinLegs, skinIndex);
if (data != null) {
customLegs.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
if (slot == SkinTypeRegistry.skinSkirt.getVanillaArmourSlotId()) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinSkirt, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinSkirt, skinIndex);
if (data != null) {
customSkirt.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
if (slot == SkinTypeRegistry.skinFeet.getVanillaArmourSlotId()) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinFeet, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinFeet, skinIndex);
if (data != null) {
customFeet.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
if (slot == 0) {
Skin data = getPlayerCustomArmour(player, SkinTypeRegistry.skinWings, skinIndex);
ISkinDye dye = getPlayerDyeData(player, SkinTypeRegistry.skinWings, skinIndex);
if (data != null) {
customWings.render(player, render.modelBipedMain, data, false, dye, extraColours, false, distance, true);
}
}
}
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
use of net.minecraft.client.renderer.entity.RenderPlayer in project takumicraft by TNTModders.
the class TakumiClientEvents method renderPlayer.
@SubscribeEvent
public void renderPlayer(Pre event) {
if (TakumiUtils.isApril(Minecraft.getMinecraft().world) && (event.getRenderer() instanceof RenderPlayer && !(event.getRenderer() instanceof RenderPlayerSP)) && event.getEntity() instanceof AbstractClientPlayer) {
event.setCanceled(true);
RenderPlayerSP sp = new RenderPlayerSP(event.getRenderer().getRenderManager());
sp.doRender(((AbstractClientPlayer) event.getEntity()), event.getX(), event.getY(), event.getZ(), ((AbstractClientPlayer) event.getEntity()).rotationYaw, event.getPartialRenderTick());
}
if (event.getEntity().isPotionActive(TakumiPotionCore.INVERSION)) {
GlStateManager.popMatrix();
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0, -1.9, 0);
}
if (event.getEntity().isPotionActive(TakumiPotionCore.CREEPERED)) {
GlStateManager.popMatrix();
float f = this.getCreeperFlashIntensity(event.getEntity(), event.getPartialRenderTick());
if (f > 0) {
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
}
}
use of net.minecraft.client.renderer.entity.RenderPlayer 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 net.minecraft.client.renderer.entity.RenderPlayer in project Armourers-Workshop by RiskyKen.
the class EquipmentWardrobeHandler method onRender.
@SubscribeEvent
public void onRender(RenderPlayerEvent.Pre event) {
EntityPlayer player = event.entityPlayer;
if (player instanceof MannequinFakePlayer) {
return;
}
if (player.getGameProfile() == null) {
return;
}
if (player instanceof FakePlayer) {
return;
}
// Hide the head overlay if the player has turned it off.
PlayerPointer playerPointer = new PlayerPointer(player);
RenderPlayer renderer = event.renderer;
if (equipmentWardrobeMap.containsKey(playerPointer)) {
EquipmentWardrobeData ewd = equipmentWardrobeMap.get(playerPointer);
renderer.modelBipedMain.bipedHeadwear.isHidden = ewd.headOverlay;
if (!ewd.headOverlay) {
if (SkinModelRenderer.INSTANCE.playerHasCustomHead(player)) {
renderer.modelBipedMain.bipedHeadwear.isHidden = true;
}
}
}
}
Aggregations