Java Code Examples for net.minecraft.util.EnumHand#MAIN_HAND

The following examples show how to use net.minecraft.util.EnumHand#MAIN_HAND . 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: BlockTatara.java    From Sakura_mod with MIT License 6 votes vote down vote up
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (worldIn.isRemote) {
    	worldIn.playSound(playerIn, pos, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, 0.8F);
           return true;
       }
	ItemStack stack = playerIn.getHeldItem(hand);
	if (hand == EnumHand.MAIN_HAND) {
        if (stack.getItem() == Items.FLINT_AND_STEEL) {
            worldIn.setBlockState(pos, BlockLoader.TATARA_SMELTING.getDefaultState());
            stack.damageItem(1, playerIn);
            return true;
        }
	}
	return true;
}
 
Example 2
Source File: RenderCodex.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
private static void renderItemInFirstPerson(AbstractClientPlayer player, EnumHand hand, float swingProgress, ItemStack stack, float equipProgress) {
	// Cherry picked from ItemRenderer.renderItemInFirstPerson
	boolean flag = hand == EnumHand.MAIN_HAND;
	EnumHandSide enumhandside = flag ? player.getPrimaryHand() : player.getPrimaryHand().opposite();
	GlStateManager.pushMatrix();
	boolean flag1 = enumhandside == EnumHandSide.RIGHT;
	float f = -0.4F * MathHelper.sin(MathHelper.sqrt(swingProgress) * (float) Math.PI);
	float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt(swingProgress) * ((float) Math.PI * 2F));
	float f2 = -0.2F * MathHelper.sin(swingProgress * (float) Math.PI);
	int i = flag1 ? 1 : -1;
	GlStateManager.translate(i * f, f1, f2);
	transformSideFirstPerson(enumhandside, equipProgress);
	transformFirstPerson(enumhandside, swingProgress);
	RenderCodex.INSTANCE.doRender(enumhandside, stack);
	GlStateManager.popMatrix();
}
 
Example 3
Source File: GTItemSprayCan.java    From GT-Classic with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
	if (playerIn.isSneaking() && handIn == EnumHand.MAIN_HAND) {
		ItemStack playerStack = playerIn.getHeldItemMainhand();
		NBTTagCompound nbt = StackUtil.getOrCreateNbtData(playerStack);
		if (nbt.hasKey(COLOR)) {
			int i = nbt.getInteger(COLOR);
			if (i + 1 > 15) {
				nbt.setInteger(COLOR, 0);
			} else {
				nbt.setInteger(COLOR, i + 1);
			}
		} else {
			nbt.setInteger(COLOR, 0);
		}
		if (!IC2.platform.isSimulating()) {
			IC2.audioManager.playOnce(playerIn, Ic2Sounds.cutterUse);
		}
		return ActionResult.newResult(EnumActionResult.SUCCESS, playerIn.getHeldItem(handIn));
	}
	return ActionResult.newResult(EnumActionResult.PASS, playerIn.getHeldItem(handIn));
}
 
Example 4
Source File: GTItemSprayCan.java    From GT-Classic with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World world, BlockPos pos, EnumFacing side,
		float hitX, float hitY, float hitZ, EnumHand handIn) {
	if (!playerIn.isSneaking() && handIn == EnumHand.MAIN_HAND) {
		ItemStack playerStack = playerIn.getHeldItemMainhand();
		NBTTagCompound nbt = StackUtil.getNbtData(playerStack);
		if (nbt.hasKey(COLOR)) {
			EnumDyeColor dye = EnumDyeColor.byDyeDamage(nbt.getInteger(COLOR));
			if (colorBlock(world.getBlockState(pos), world, pos, null, dye)) {
				if (playerStack.getItemDamage() < playerStack.getMaxDamage()) {
					playerStack.damageItem(1, playerIn);
					if (!IC2.platform.isSimulating()) {
						IC2.audioManager.playOnce(playerIn, Ic2Sounds.painterUse);
					}
				} else {
					playerIn.setHeldItem(handIn, GTMaterialGen.get(GTItems.sprayCanEmpty));
					if (!IC2.platform.isSimulating()) {
						playerIn.playSound(SoundEvents.ENTITY_ITEM_BREAK, 1.0F, 1.0F);
					}
				}
				return EnumActionResult.SUCCESS;
			}
		}
	}
	return EnumActionResult.PASS;
}
 
Example 5
Source File: ModelTofuMindCore.java    From TofuCraftReload with MIT License 5 votes vote down vote up
protected EnumHandSide getMainHand(Entity entityIn) {
    if (entityIn instanceof EntityLivingBase) {
        EntityLivingBase entitylivingbase = (EntityLivingBase) entityIn;
        EnumHandSide enumhandside = entitylivingbase.getPrimaryHand();
        return entitylivingbase.swingingHand == EnumHand.MAIN_HAND ? enumhandside : enumhandside.opposite();
    } else {
        return EnumHandSide.RIGHT;
    }
}
 
Example 6
Source File: ProxyCommon.java    From WearableBackpacks with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onPlayerInteractBlock(PlayerInteractEvent.RightClickBlock event) {

	// This event is fired twice, once for each hand. Unfortunately there
	// is no way to set the result of the main hand interaction to SUCCESS
	// so the off hand one will be skipped. So: Hacky code!

	if (cancelOffHand) {
		cancelOffHand = false;
		if (event.getHand() == EnumHand.OFF_HAND)
			{ event.setCanceled(true); return; }
	}

	// When players sneak-right-click the ground with an
	// empty hand, place down their equipped backpack.

	EntityPlayer player = event.getEntityPlayer();
	World world = event.getWorld();
	if (!player.isSneaking() || (event.getHand() != EnumHand.MAIN_HAND) ||
	    !player.getHeldItem(EnumHand.MAIN_HAND).isEmpty()) return;

	IBackpack backpack = BackpackHelper.getBackpack(player);
	if (backpack == null) return;

	// Try place the equipped backpack on the ground by using it. Also takes
	// care of setting the tile entity stack and data as well as unequipping.
	// See ItemBackpack.onItemUse.
	player.inventory.mainInventory.set(player.inventory.currentItem, backpack.getStack());
	if (backpack.getStack().onItemUse(
			player, world, event.getPos(), EnumHand.MAIN_HAND,
			event.getFace(), 0.5F, 0.5F, 0.5F) == EnumActionResult.SUCCESS) {

		player.swingArm(EnumHand.MAIN_HAND);
		event.setCanceled(true);
		cancelOffHand = true;

	} else player.inventory.mainInventory.set(player.inventory.currentItem, ItemStack.EMPTY);

}
 
Example 7
Source File: EntityUtils.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Sets the held item, without playing the equip sound.
 * @param player
 * @param hand
 * @param stack
 */
public static void setHeldItemWithoutEquipSound(EntityPlayer player, EnumHand hand, ItemStack stack)
{
    if (hand == EnumHand.MAIN_HAND)
    {
        player.inventory.mainInventory.set(player.inventory.currentItem, stack);
    }
    else if (hand == EnumHand.OFF_HAND)
    {
        player.inventory.offHandInventory.set(0, stack);
    }
}
 
Example 8
Source File: ItemOreScanner.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@Override
public EnumActionResult onItemUse(EntityPlayer playerIn,
		World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing,
		float hitX, float hitY, float hitZ) {
	if(!playerIn.world.isRemote && hand == EnumHand.MAIN_HAND)
		playerIn.openGui(AdvancedRocketry.instance, GuiHandler.guiId.OreMappingSatellite.ordinal(), worldIn, (int)playerIn.getPosition().getX(), (int)getSatelliteID(playerIn.getHeldItem(hand)), (int)playerIn.getPosition().getZ());

	return super.onItemUse(playerIn, worldIn, pos, hand, facing, hitX, hitY,
			hitZ);
}
 
Example 9
Source File: EssentialsMissingHandler.java    From Cyberware with MIT License 5 votes vote down vote up
private void processEvent(Event event, EnumHand hand, EntityPlayer p, ICyberwareUserData cyberware)
{
	EnumHandSide mainHand = p.getPrimaryHand();
	EnumHandSide offHand = ((mainHand == EnumHandSide.LEFT) ? EnumHandSide.RIGHT : EnumHandSide.LEFT);
	EnumSide correspondingMainHand = ((mainHand == EnumHandSide.RIGHT) ? EnumSide.RIGHT : EnumSide.LEFT);
	EnumSide correspondingOffHand = ((offHand == EnumHandSide.RIGHT) ? EnumSide.RIGHT : EnumSide.LEFT);
	
	boolean leftUnpowered = false;
	ItemStack armLeft = cyberware.getCyberware(new ItemStack(CyberwareContent.cyberlimbs, 1, 0));
	if (armLeft != null && !ItemCyberlimb.isPowered(armLeft))
	{
		leftUnpowered = true;
	}
	
	boolean rightUnpowered = false;
	ItemStack armRight = cyberware.getCyberware(new ItemStack(CyberwareContent.cyberlimbs, 1, 1));
	if (armRight != null && !ItemCyberlimb.isPowered(armRight))
	{
		rightUnpowered = true;
	}

	if (hand == EnumHand.MAIN_HAND && (!cyberware.hasEssential(EnumSlot.ARM, correspondingMainHand) || leftUnpowered))
	{
		event.setCanceled(true);
	}
	else if (hand == EnumHand.OFF_HAND && (!cyberware.hasEssential(EnumSlot.ARM, correspondingOffHand) || rightUnpowered))
	{
		event.setCanceled(true);
	}
}
 
Example 10
Source File: ICooldownSpellCaster.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
default void setCooldown(World world, @Nullable EntityPlayer player, @Nullable EnumHand hand, ItemStack stack, @Nonnull SpellData data) {
	int maxCooldown = 0;

	List<SpellRing> rings = SpellUtils.getAllSpellRings(stack);

	for (SpellRing ring : rings) {
		if (ring.isContinuous()) return;

		if (ring.getModule() != null && ring.getModule().getModuleClass() instanceof IOverrideCooldown) {

			maxCooldown = ring.getCooldownTime(world, data);
			break;
		}
		if (ring.getCooldownTime() > maxCooldown)
			maxCooldown = ring.getCooldownTime();
	}

	if (maxCooldown <= 0) return;

	if (player != null && hand != null) {
		player.stopActiveHand();
		player.swingArm(hand);
		if (!world.isRemote)
			if (hand == EnumHand.MAIN_HAND)
				PacketHandler.NETWORK.sendTo(new PacketSyncCooldown(true, false), (EntityPlayerMP) player);
			else PacketHandler.NETWORK.sendTo(new PacketSyncCooldown(false, true), (EntityPlayerMP) player);
	}

	NBTHelper.setInt(stack, NBTConstants.NBT.LAST_COOLDOWN, maxCooldown);
	NBTHelper.setLong(stack, NBTConstants.NBT.LAST_CAST, world.getTotalWorldTime());
}
 
Example 11
Source File: EntityUtils.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Checks if the requested item is currently in the player's hand such that it would be used for using/placing.
 * This means, that it must either be in the main hand, or the main hand must be empty and the item is in the offhand.
 * @param player
 * @param stack
 * @param lenient if true, then NBT tags and also damage of damageable items are ignored
 * @return
 */
@Nullable
public static EnumHand getUsedHandForItem(EntityPlayer player, ItemStack stack, boolean lenient)
{
    EnumHand hand = null;

    if (lenient)
    {
        if (ItemStack.areItemsEqualIgnoreDurability(player.getHeldItemMainhand(), stack))
        {
            hand = EnumHand.MAIN_HAND;
        }
        else if (player.getHeldItemMainhand().isEmpty() && ItemStack.areItemsEqualIgnoreDurability(player.getHeldItemOffhand(), stack))
        {
            hand = EnumHand.OFF_HAND;
        }
    }
    else
    {
        if (InventoryUtils.areStacksEqual(player.getHeldItemMainhand(), stack))
        {
            hand = EnumHand.MAIN_HAND;
        }
        else if (player.getHeldItemMainhand().isEmpty() && InventoryUtils.areStacksEqual(player.getHeldItemOffhand(), stack))
        {
            hand = EnumHand.OFF_HAND;
        }
    }

    return hand;
}
 
Example 12
Source File: ModGenuinePeoplePersonalities.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onBlockActivated(PlayerInteractEvent.RightClickBlock event) {
    EventData data = new EventData(event);
    if (data.getPlayer() == null || data.getPlayer().world.isRemote) return;
    if (data.getHand() != EnumHand.MAIN_HAND) return;
    if (!testCooldown(data.getPlayer())) return;
    if (generateComplaint(StringType.ACTIVATE, data.getPlayer(), data.getBlock(), data)) {
        resetCooldown(data.getPlayer());
    }
}
 
Example 13
Source File: ModGenuinePeoplePersonalities.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onBlockHit(PlayerInteractEvent.LeftClickBlock event) {
    EventData data = new EventData(event);
    if (data.getPlayer() == null || data.getPlayer().world.isRemote) return;
    if (data.getHand() != EnumHand.MAIN_HAND) return;
    if (!testCooldown(data.getPlayer())) return;
    if (generateComplaint(StringType.ATTACK, data.getPlayer(), data.getBlock(), data)) {
        resetCooldown(data.getPlayer());
    }
}
 
Example 14
Source File: EntityPenguin.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
	boolean ret = super.processInteract(player, hand);
	if (player.world.isRemote && hand == EnumHand.MAIN_HAND) {
		player.sendMessage(new TextComponentString(
				"If you like these penguins, you'll like the full version more!"));
		player.sendMessage(new TextComponentString("Click [here] to download it on CurseForge.")
				.setStyle(new Style().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,
						"https://minecraft.curseforge.com/projects/penguins"))));
	}
	return ret;
}
 
Example 15
Source File: BlockOben.java    From Sakura_mod with MIT License 5 votes vote down vote up
@Override
  public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
      if (worldIn.isRemote)
          return true;
      
ItemStack stack = playerIn.getHeldItem(hand);
TileEntity tile = worldIn.getTileEntity(pos);
if (hand == EnumHand.MAIN_HAND) {
    if (tile instanceof TileEntityOben) {
    	TileEntityOben tileEntity = (TileEntityOben) tile;
        if(!(tileEntity.getInventory().getStackInSlot(0)).isEmpty()&&!(stack.equals(tileEntity.getInventory().getStackInSlot(0)))){
            Block.spawnAsEntity(worldIn, pos, tileEntity.getInventory().getStackInSlot(0));
            tileEntity.getInventory().setStackInSlot(0, ItemStack.EMPTY);
            tileEntity.markDirty();
            return true;
        }
		ItemStack campfireStack=stack.copy();
		campfireStack.setCount(1);
		stack.shrink(1);
		tileEntity.getInventory().insertItem(0,campfireStack,false);
		tileEntity.markDirty();
		return true;
    }
}

return true;
  }
 
Example 16
Source File: EntityTofunian.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public boolean processInteract(EntityPlayer player, EnumHand hand) {
    ItemStack itemstack = player.getHeldItem(hand);
    boolean flag = itemstack.getItem() == Items.NAME_TAG;

    if (flag) {
        itemstack.interactWithEntity(player, this, hand);
        return true;
    } else if (!this.holdingSpawnEggOfClass(itemstack, this.getClass()) && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) {
        if (this.buyingList == null) {
            this.initTrades();
        }

        if (hand == EnumHand.MAIN_HAND) {
            player.addStat(StatList.TALKED_TO_VILLAGER);
        }

        if (!this.world.isRemote && !this.buyingList.isEmpty()) {
            this.setCustomer(player);
            player.displayVillagerTradeGui(this);
        } else if (this.buyingList.isEmpty()) {
            return super.processInteract(player, hand);
        }

        return true;
    } else {
        return super.processInteract(player, hand);
    }
}
 
Example 17
Source File: ContentGuiContainer.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
private ContainerGui createContainer(ItemStack stack, EntityPlayer player, EnumHand hand)
{
    ItemHandlerSupplier itemHandlerSupplier = stack.getCapability(CapabilityItemHandlerSupplier.ITEM_HANDLER_SUPPLIER_CAPABILITY, null);
    int itemSlot = hand == EnumHand.MAIN_HAND ? player.inventory.currentItem : -1;
    return new ContainerGui(this, itemHandlerSupplier, FluidSource.EMPTY, FieldSupplier.EMPTY, player, itemSlot);
}
 
Example 18
Source File: ClientProxy.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void setItemStackHandHandler(EnumHand hand, ItemStack stack) {
	if (hand == EnumHand.MAIN_HAND)
		itemStackMainHandHandler.invoke(Minecraft.getMinecraft().getItemRenderer(), stack);
	else itemStackOffHandHandler.invoke(Minecraft.getMinecraft().getItemRenderer(), stack);
}
 
Example 19
Source File: RenderCyberlimbHand.java    From Cyberware with MIT License 4 votes vote down vote up
public void renderItemInFirstPerson(AbstractClientPlayer p_187457_1_, float p_187457_2_, float p_187457_3_, EnumHand p_187457_4_, float p_187457_5_, @Nullable ItemStack p_187457_6_, float p_187457_7_)
{
	boolean flag = p_187457_4_ == EnumHand.MAIN_HAND;
	EnumHandSide enumhandside = flag ? p_187457_1_.getPrimaryHand() : p_187457_1_.getPrimaryHand().opposite();
	GlStateManager.pushMatrix();

	if (p_187457_6_ == null)
	{
		if (flag && !p_187457_1_.isInvisible())
		{
			
			this.renderArmFirstPerson(p_187457_7_, p_187457_5_, enumhandside);
		}
	}
	else if (p_187457_6_.getItem() instanceof net.minecraft.item.ItemMap)
	{
		if (flag && itemStackOffHand == null)
		{
			this.renderMapFirstPerson(p_187457_3_, p_187457_7_, p_187457_5_);
		}
		else
		{
			this.renderMapFirstPersonSide(p_187457_7_, enumhandside, p_187457_5_, p_187457_6_);
		}
	}
	else
	{
		boolean flag1 = enumhandside == EnumHandSide.RIGHT;

		if (p_187457_1_.isHandActive() && p_187457_1_.getItemInUseCount() > 0 && p_187457_1_.getActiveHand() == p_187457_4_)
		{
			int j = flag1 ? 1 : -1;

			switch (p_187457_6_.getItemUseAction())
			{
				case NONE:
					this.transformSideFirstPerson(enumhandside, p_187457_7_);
					break;
				case EAT:
				case DRINK:
					this.transformEatFirstPerson(p_187457_2_, enumhandside, p_187457_6_);
					this.transformSideFirstPerson(enumhandside, p_187457_7_);
					break;
				case BLOCK:
					this.transformSideFirstPerson(enumhandside, p_187457_7_);
					break;
				case BOW:
					this.transformSideFirstPerson(enumhandside, p_187457_7_);
					GlStateManager.translate((float)j * -0.2785682F, 0.18344387F, 0.15731531F);
					GlStateManager.rotate(-13.935F, 1.0F, 0.0F, 0.0F);
					GlStateManager.rotate((float)j * 35.3F, 0.0F, 1.0F, 0.0F);
					GlStateManager.rotate((float)j * -9.785F, 0.0F, 0.0F, 1.0F);
					float f5 = (float)p_187457_6_.getMaxItemUseDuration() - ((float)this.mc.thePlayer.getItemInUseCount() - p_187457_2_ + 1.0F);
					float f6 = f5 / 20.0F;
					f6 = (f6 * f6 + f6 * 2.0F) / 3.0F;

					if (f6 > 1.0F)
					{
						f6 = 1.0F;
					}

					if (f6 > 0.1F)
					{
						float f7 = MathHelper.sin((f5 - 0.1F) * 1.3F);
						float f3 = f6 - 0.1F;
						float f4 = f7 * f3;
						GlStateManager.translate(f4 * 0.0F, f4 * 0.004F, f4 * 0.0F);
					}

					GlStateManager.translate(f6 * 0.0F, f6 * 0.0F, f6 * 0.04F);
					GlStateManager.scale(1.0F, 1.0F, 1.0F + f6 * 0.2F);
					GlStateManager.rotate((float)j * 45.0F, 0.0F, -1.0F, 0.0F);
			}
		}
		else
		{
			float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(p_187457_5_) * (float)Math.PI);
			float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(p_187457_5_) * ((float)Math.PI * 2F));
			float f2 = -0.2F * MathHelper.sin(p_187457_5_ * (float)Math.PI);
			int i = flag1 ? 1 : -1;
			GlStateManager.translate((float)i * f, f1, f2);
			this.transformSideFirstPerson(enumhandside, p_187457_7_);
			this.transformFirstPerson(enumhandside, p_187457_5_);
		}

		this.renderItemSide(p_187457_1_, p_187457_6_, flag1 ? ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND : ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag1);
	}

	GlStateManager.popMatrix();
}
 
Example 20
Source File: EssentialsMissingHandlerClient.java    From Cyberware with MIT License 4 votes vote down vote up
private void renderItemInFirstPerson(float partialTicks)
{
	ItemRenderer ir = mc.getItemRenderer();
	AbstractClientPlayer abstractclientplayer = mc.thePlayer;
	float f = abstractclientplayer.getSwingProgress(partialTicks);
	EnumHand enumhand = (EnumHand)Objects.firstNonNull(abstractclientplayer.swingingHand, EnumHand.MAIN_HAND);
	float f1 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
	float f2 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
	boolean flag = true;
	boolean flag1 = true;

	if (abstractclientplayer.isHandActive())
	{
		ItemStack itemstack = abstractclientplayer.getActiveItemStack();

		if (itemstack != null && itemstack.getItem() == Items.BOW) //Forge: Data watcher can desync and cause this to NPE...
		{
			EnumHand enumhand1 = abstractclientplayer.getActiveHand();
			flag = enumhand1 == EnumHand.MAIN_HAND;
			flag1 = !flag;
		}
	}

	rotateArroundXAndY(f1, f2);
	setLightmap();
	rotateArm(partialTicks);
	GlStateManager.enableRescaleNormal();

	ItemStack itemStackMainHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 3);
	ItemStack itemStackOffHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 4);
	float equippedProgressMainHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 5);
	float prevEquippedProgressMainHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 6);
	float equippedProgressOffHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 7);
	float prevEquippedProgressOffHand = ReflectionHelper.getPrivateValue(ItemRenderer.class, ir, 8);

	RenderCyberlimbHand.INSTANCE.itemStackMainHand = itemStackMainHand;
	RenderCyberlimbHand.INSTANCE.itemStackOffHand = itemStackOffHand;

	if (flag && !missingSecondArm)
	{
		float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
		float f5 = 1.0F - (prevEquippedProgressMainHand + (equippedProgressMainHand - prevEquippedProgressMainHand) * partialTicks);
		RenderCyberlimbHand.INSTANCE.leftRobot = hasRoboLeft;
		RenderCyberlimbHand.INSTANCE.rightRobot = hasRoboRight;
		RenderCyberlimbHand.INSTANCE.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.MAIN_HAND, f3, itemStackMainHand, f5);
	}

	if (flag1 && !missingArm)
	{
		float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
		float f6 = 1.0F - (prevEquippedProgressOffHand + (equippedProgressOffHand - prevEquippedProgressOffHand) * partialTicks);
		RenderCyberlimbHand.INSTANCE.leftRobot = hasRoboLeft;
		RenderCyberlimbHand.INSTANCE.rightRobot = hasRoboRight;
		RenderCyberlimbHand.INSTANCE.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.OFF_HAND, f4, itemStackOffHand, f6);
	}

	GlStateManager.disableRescaleNormal();
	RenderHelper.disableStandardItemLighting();
}