@SideOnly(Side.CLIENT) @SubscribeEvent public void renderItem(RenderSpecificHandEvent event) { Minecraft minecraft = Minecraft.getMinecraft(); if (event.getHand() == EnumHand.MAIN_HAND) { if (minecraft.gameSettings.thirdPersonView != 0 || minecraft.player.getHeldItem(EnumHand.MAIN_HAND).func_190916_E() <= 0 || minecraft.player.getHeldItem(EnumHand.MAIN_HAND).getItem() != InfernumItems.KNOWLEDGE_BOOK) { reset(); return; } if ((minecraft.player.getHeldItem(EnumHand.OFF_HAND).equals(ItemStack.field_190927_a))) { event.setCanceled(true); try { ticksOpen++; doRender(event.getPartialTicks(), minecraft.player.getHeldItem(event.getHand())); } catch (Throwable throwable) { } } else { reset(); } } }
@SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST) public void onRenderHand(RenderSpecificHandEvent event) { Minecraft.getMinecraft(); AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer) CrystalMod.proxy.getClientPlayer(); ExtendedPlayer ePlayer = ExtendedPlayerProvider.getExtendedPlayer(abstractclientplayer); if(ePlayer !=null && ePlayer.getPlayerDisguiseUUID() !=null) { boolean flag = event.getHand() == EnumHand.MAIN_HAND; EnumHandSide enumhandside = flag ? abstractclientplayer.getPrimaryHand() : abstractclientplayer.getPrimaryHand().opposite(); if (ItemStackTools.isNullStack(event.getItemStack())) { if (flag && !abstractclientplayer.isInvisible()) { event.setCanceled(true); GlStateManager.pushMatrix(); renderArmFirstPerson(event.getEquipProgress(), event.getSwingProgress(), enumhandside, ePlayer.isMini()); GlStateManager.popMatrix(); } } } }
@SubscribeEvent public static void onRenderHand(RenderSpecificHandEvent ev) { EntityPlayer player = Minecraft.getMinecraft().player; if (!player.isSneaking() && ev.getItemStack().getItem() instanceof ItemParchment) { float f = player.getSwingProgress(ev.getPartialTicks()); float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * ev.getPartialTicks(); ItemRenderer itemrenderer = Minecraft.getMinecraft().getItemRenderer(); float prevEquipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.prevEquippedProgressMainHand : itemrenderer.prevEquippedProgressOffHand; float equipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.equippedProgressMainHand : itemrenderer.equippedProgressOffHand; float f5 = 1.0F - (prevEquipProgress + (equipProgress - prevEquipProgress) * ev.getPartialTicks()); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); if (ev.getHand() == EnumHand.MAIN_HAND && player.getHeldItemOffhand().isEmpty()) { GLHelper.renderParchmentFirstPerson(f1, f5, f, ev.getItemStack()); } else { EnumHandSide enumhandside = ev.getHand() == EnumHand.MAIN_HAND ? player.getPrimaryHand() : player.getPrimaryHand().opposite(); GLHelper.renderParchmentFirstPersonSide(f5, enumhandside, f, ev.getItemStack()); } GlStateManager.popAttrib(); GlStateManager.popMatrix(); ev.setCanceled(true); } }
@SubscribeEvent public void renderSpecificHand(RenderSpecificHandEvent event) { EntityPlayer player=Minecraft.getMinecraft().player; if((event.getItemStack().getItem() instanceof ItemCloak && !WeaponsCapability.get(player).isFeign() && ((ItemCloak)event.getItemStack().getItem()).isFeignDeath(event.getItemStack(), player))) { event.setCanceled(true); } }
public static void onRenderSpecificHand(RenderSpecificHandEvent event) { if(event.getHand() == EnumHand.MAIN_HAND && event.getItemStack().isEmpty()) { ItemStack is = Minecraft.getMinecraft().player.getHeldItem(EnumHand.OFF_HAND); if(!is.isEmpty() && ItemHandler.isItemDualHanded(is)) { event.setCanceled(true); } } }
public static boolean renderSpecificFirstPersonHand(EnumHand hand, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) { return MinecraftForge.EVENT_BUS.post(new RenderSpecificHandEvent(hand, partialTicks, interpPitch, swingProgress, equipProgress, stack)); }
@SubscribeEvent public void onRenderHand(RenderSpecificHandEvent event) { PlayerGloveRenderer.renderItemFirstPerson(Minecraft.getMinecraft().thePlayer, event.getPartialTicks(), event.getInterpolatedPitch(), event.getHand(), event.getSwingProgress(), event.getItemStack(), event.getEquipProgress()); }
@SubscribeEvent @SideOnly(Side.CLIENT) public static void onRenderSpecificHand(RenderSpecificHandEvent event) { if (projectionState) AlchemyEventSystem.markEventCanceled(event); }
@SubscribeEvent public void onRenderSpecificHand(RenderSpecificHandEvent event) { ItemRenderingHelper.onRenderSpecificHand(event); }