Robotic Parts

Robotic Parts

2M Downloads

Neuropozyne is unable to be used

mallrat208 opened this issue ยท 1 comments

commented

public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
if (!playerIn.capabilities.isCreativeMode)
{
stack.shrink(1);
}
playerIn.addPotionEffect(new PotionEffect(CyberwareContent.neuropozyneEffect, 24000, 0, false, false));
return new ActionResult(EnumActionResult.SUCCESS, stack);
}

This isn't the right method for an items onItemRightClick, ItemStack is no longer one of the parameters and should be replaced with something like the following

	@Override
	public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
		ItemStack stack = playerIn.getHeldItem(handIn);
		if (!playerIn.capabilities.isCreativeMode)
		{
			stack.shrink(1);
		}

		playerIn.addPotionEffect(new PotionEffect(CyberwareContent.neuropozyneEffect, 24000, 0, false, false));

		return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
	}
commented

pushed to 1.12 branch