net.minecraftforge.client.event.RenderPlayerEvent Java Examples
The following examples show how to use
net.minecraftforge.client.event.RenderPlayerEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CapeHandler.java From Wizardry with GNU Lesser General Public License v3.0 | 6 votes |
@SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Post event) { EntityPlayer player = event.getEntityPlayer(); float delta = event.getPartialRenderTick(); if (ClientConfigValues.renderCape && !player.isInvisible() && !VanishTracker.isVanished(player) && !player.isElytraFlying() && !player.isPlayerSleeping() && delta != 1) { RenderCape cape = getCape(player); if (cape.isPresent(player)) { cape.render( player, player.posX - cape.posX - TileEntityRendererDispatcher.staticPlayerX, player.posY - cape.posY - TileEntityRendererDispatcher.staticPlayerY, player.posZ - cape.posZ - TileEntityRendererDispatcher.staticPlayerZ, delta ); } } }
Example #2
Source File: RenderComponents.java From AdvancedRocketry with MIT License | 6 votes |
@SubscribeEvent public void renderPostSpecial(RenderPlayerEvent.Post event) { //RenderJet pack //RenderJetPack pack = new RenderJetPack(); ItemStack chest = event.getEntityLiving().getItemStackFromSlot(EntityEquipmentSlot.CHEST); if(chest != null && chest.getItem() instanceof IModularArmor) { for(ItemStack stack : ((IModularArmor)chest.getItem()).getComponents(chest)) { if(stack.getItem() == AdvancedRocketryItems.itemJetpack) { GL11.glPushMatrix(); float f = event.getEntityPlayer().prevRotationYaw + (event.getEntityPlayer().rotationYaw - event.getEntityPlayer().prevRotationYaw); GL11.glRotatef(f + 180, 0,-1,0); //pack.render(event.getEntityLiving(), 0, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } } } }
Example #3
Source File: RenderEventHandler.java From DeveloperCapes with MIT License | 6 votes |
@SubscribeEvent public void renderPlayer(RenderPlayerEvent.Specials.Pre event) { AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer; UserManager manager = UserManager.getInstance(); User user = manager.getUser(player.getUniqueID().toString()); if (user == null) return; ICape cape = user.capes.get(0); if (cape == null) return; boolean flag = cape.isTextureLoaded(player); if (!flag) { cape.loadTexture(player); } }
Example #4
Source File: ClientProxy.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@SubscribeEvent public static void onPlayerRender(RenderPlayerEvent.Pre event) { AbstractClientPlayer clientPlayer = (AbstractClientPlayer) event.getEntityPlayer(); if (capeHoldersUUIDs.contains(clientPlayer.getUniqueID()) && clientPlayer.hasPlayerInfo() && clientPlayer.getLocationCape() == null) { NetworkPlayerInfo playerInfo = ObfuscationReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clientPlayer, 0); Map<Type, ResourceLocation> playerTextures = ObfuscationReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, playerInfo, 1); playerTextures.put(Type.CAPE, GREGTECH_CAPE_TEXTURE); } }
Example #5
Source File: ClientEventHandler.java From Et-Futurum with The Unlicense | 5 votes |
@SubscribeEvent public void renderPlayerEventPre(RenderPlayerEvent.Pre event) { if (EtFuturum.enableTransparentAmour) { OpenGLHelper.enableBlend(); OpenGLHelper.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); } }
Example #6
Source File: PlayerSpecials.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@SubscribeEvent public void onPlayerRenderSpecialPre(RenderPlayerEvent.Specials.Pre event) { Collection<IDevRenderer> renders = renderMap.get(event.entityPlayer.getUniqueID()); for (IDevRenderer r : renders) { r.renderExtras(event.entityPlayer, false); } }
Example #7
Source File: PlayerSpecials.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@SubscribeEvent public void onPlayerRenderSpecialPost(RenderPlayerEvent.Specials.Post event) { Collection<IDevRenderer> renders = renderMap.get(event.entityPlayer.getUniqueID()); for (IDevRenderer r : renders) { r.renderExtras(event.entityPlayer, true); } }
Example #8
Source File: ProxyClient.java From WearableBackpacks with MIT License | 5 votes |
@SubscribeEvent(priority=EventPriority.LOWEST) public void onRenderPlayerPre(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); if ((BackpackHelper.getBackpack(player) == null) || !player.isWearing(EnumPlayerModelParts.CAPE)) return; // Disable player rendering for players with equipped backpacks // by temporarily setting whether they are wearing it to false. setWearing(player, EnumPlayerModelParts.CAPE, false); _disabledCape = true; }
Example #9
Source File: ProxyClient.java From WearableBackpacks with MIT License | 5 votes |
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onRenderPlayerPost(RenderPlayerEvent.Post event) { if (!_disabledCape) return; // Reenable cape rendering if it was disabled. EntityPlayer player = event.getEntityPlayer(); setWearing(player, EnumPlayerModelParts.CAPE, true); _disabledCape = false; }
Example #10
Source File: WaifuESP.java From ForgeHax with MIT License | 4 votes |
@SubscribeEvent public void onRenderPlayer(RenderPlayerEvent.Pre event) { if (noRenderPlayers.getAsBoolean() && !event.getEntity().equals(MC.player)) { event.setCanceled(true); } }
Example #11
Source File: EssentialsMissingHandlerClient.java From Cyberware with MIT License | 4 votes |
@SideOnly(Side.CLIENT) @SubscribeEvent public void handleMissingSkin(RenderPlayerEvent.Post event) { if (CyberwareConfig.RENDER) { event.getRenderer().getMainModel().bipedLeftArm.isHidden = false; event.getRenderer().getMainModel().bipedRightArm.isHidden = false; event.getRenderer().getMainModel().bipedLeftLeg.isHidden = false; event.getRenderer().getMainModel().bipedRightLeg.isHidden = false; EntityPlayer p = event.getEntityPlayer(); if (CyberwareAPI.hasCapability(p)) { ICyberwareUserData cyberware = CyberwareAPI.getCapability(p); if (pants.containsKey(p.getEntityId())) { p.inventory.armorInventory[1] = pants.get(p.getEntityId()); pants.remove(p.getEntityId()); } if (shoes.containsKey(p.getEntityId())) { p.inventory.armorInventory[0] = shoes.get(p.getEntityId()); shoes.remove(p.getEntityId()); } if (!cyberware.hasEssential(EnumSlot.ARM, EnumSide.LEFT)) { event.getRenderer().getMainModel().bipedLeftArm.isHidden = false; if (mainHand.containsKey(p.getEntityId())) { p.inventory.mainInventory[p.inventory.currentItem] = mainHand.get(p.getEntityId()); p.inventory.offHandInventory[0] = offHand.get(p.getEntityId()); mainHand.remove(p.getEntityId()); offHand.remove(p.getEntityId()); } } if (!cyberware.hasEssential(EnumSlot.ARM, EnumSide.RIGHT)) { event.getRenderer().getMainModel().bipedRightArm.isHidden = false; if (mainHand.containsKey(p.getEntityId())) { p.inventory.mainInventory[p.inventory.currentItem] = mainHand.get(p.getEntityId()); p.inventory.offHandInventory[0] = offHand.get(p.getEntityId()); mainHand.remove(p.getEntityId()); offHand.remove(p.getEntityId()); } } } } }
Example #12
Source File: ClientEventHandler.java From Et-Futurum with The Unlicense | 4 votes |
@SubscribeEvent public void renderPlayerEventPost(RenderPlayerEvent.Post event) { if (EtFuturum.enableTransparentAmour) OpenGLHelper.disableBlend(); }
Example #13
Source File: ClientEventHandler.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
@SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Pre event){ playerRenderPartialTick = event.partialRenderTick; if(!Config.useHelmetModel && !DateEventHandler.isIronManEvent() || event.entityPlayer.getCurrentArmor(3) == null || event.entityPlayer.getCurrentArmor(3).getItem() != Itemss.pneumaticHelmet) return; event.renderer.modelBipedMain.bipedHead.showModel = false; }
Example #14
Source File: ClientEventHandler.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
@SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Post event){ event.renderer.modelBipedMain.bipedHead.showModel = true; }
Example #15
Source File: IBaubleRender.java From ForbiddenMagic with Do What The F*ck You Want To Public License | 2 votes |
/** * Called for the rendering of the bauble on the player. The player instance can be * acquired through the event parameter. Transformations are already applied for * the RenderType passed in. Make sure to check against the type parameter for * rendering. Will not be called if the item is a ICosmeticAttachable and * has a cosmetic bauble attached to it. */ @SideOnly(Side.CLIENT) public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type);