mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Fixed a couple of bugs with items that need to be held not working
This commit is contained in:
parent
eed5cbdc92
commit
bfc68919f3
6 changed files with 6 additions and 6 deletions
|
@ -104,7 +104,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy());
|
||||
}
|
||||
else{
|
||||
player.getActiveItemStack().stackSize += tile.slots[0].stackSize;
|
||||
stackPlayer.stackSize += tile.slots[0].stackSize;
|
||||
}
|
||||
tile.slots[0] = null;
|
||||
tile.markDirty();
|
||||
|
|
|
@ -111,7 +111,7 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
}
|
||||
|
||||
public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){
|
||||
ItemStack stack = player.getActiveItemStack();
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IRedstoneToggle){
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ItemGrowthRing extends ItemEnergy{
|
|||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
ItemStack equipped = player.getActiveItemStack();
|
||||
ItemStack equipped = player.getHeldItemMainhand();
|
||||
|
||||
int energyUse = 300;
|
||||
if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem{
|
|||
if(!world.isRemote && stack.getItemDamage() < allRings.length){
|
||||
if(player instanceof EntityPlayer){
|
||||
EntityPlayer thePlayer = (EntityPlayer)player;
|
||||
ItemStack equippedStack = ((EntityPlayer)player).getActiveItemStack();
|
||||
ItemStack equippedStack = ((EntityPlayer)player).getHeldItemMainhand();
|
||||
|
||||
ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()];
|
||||
Potion potion = Potion.getPotionById(effect.effectID);
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ItemWaterRemovalRing extends ItemEnergy{
|
|||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
ItemStack equipped = player.getActiveItemStack();
|
||||
ItemStack equipped = player.getHeldItemMainhand();
|
||||
|
||||
int energyUse = 350;
|
||||
if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){
|
||||
|
|
|
@ -354,7 +354,7 @@ public class WorldUtil{
|
|||
Block block = PosUtil.getBlock(pos, world);
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
ItemStack stack = player.getActiveItemStack();
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
|
||||
//If the Block can be harvested or not
|
||||
boolean canHarvest = block.canHarvestBlock(world, pos, player);
|
||||
|
|
Loading…
Reference in a new issue