Giving hand item copies stack size bug

Published by Anonymous (not verified) on
Status
Fixed
Issue description

When you copy hand in 1.8.3 and state you want to return one item the stack size is not added to the code, it just copies the stack size in your hand so you end up doubling up to a stack of 64 then after that it copies a full stack.

 

	public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			System.err.println("Failed to load dependency entity for procedure testblockOnBlockRightClicked!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		if (entity instanceof EntityPlayer)
			ItemHandlerHelper.giveItemToPlayer(((EntityPlayer) entity),
					((entity instanceof EntityLivingBase) ? ((EntityLivingBase) entity).getHeldItemMainhand() : null));
	}

The stack size is missing from the code above, but the producer makes you believe a stack side has been set, this seems to only happen when you use the from hand option
if your given a new item it sets the item with a stack size.

https://i.imgur.com/waMTqqk.png
 

	public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			System.err.println("Failed to load dependency entity for procedure testblockOnBlockRightClicked!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		if (entity instanceof EntityPlayer)
			ItemHandlerHelper.giveItemToPlayer(((EntityPlayer) entity),
					((entity instanceof EntityLivingBase) ? ((EntityLivingBase) entity).getHeldItemMainhand() : null));

		// new item has a stack amount			
		if (entity instanceof EntityPlayer)
			ItemHandlerHelper.giveItemToPlayer(((EntityPlayer) entity), new ItemStack(Blocks.SLIME_BLOCK, (int) (1)));
	}

It seems you have over looked the stack size in the get hand option or at least some anitation saying stack size will depend on held size.

Issue comments

This one I haven't been able to find a work around for as of yet so if you come up with a fix before hand please hit us back :)