Fixes incorrect onItemUse declaration, which in turn fixes the color applicator.

This commit is contained in:
Sebastian Hartte
2016-09-12 01:46:55 +02:00
parent 5b6ed0cfd0
commit 6a5add38e2
4 changed files with 24 additions and 19 deletions
@@ -40,7 +40,9 @@ import net.minecraft.item.ItemSnowball;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
@@ -107,7 +109,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
}
@Override
public boolean onItemUse( final ItemStack is, final EntityPlayer p, final World w, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public EnumActionResult onItemUse( ItemStack is, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
final Block blk = w.getBlockState( pos ).getBlock();
@@ -130,7 +132,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
if( !Platform.hasPermissions( new DimensionalCoord( w, pos ), p ) )
{
return false;
return EnumActionResult.FAIL;
}
final double powerPerUse = 100;
@@ -146,7 +148,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
this.extractAEPower( is, powerPerUse );
return true;
return EnumActionResult.SUCCESS;
}
}
}
@@ -159,7 +161,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
this.extractAEPower( is, powerPerUse );
( (TilePaint) painted ).cleanSide( side.getOpposite() );
return true;
return EnumActionResult.SUCCESS;
}
}
else if( paintBall != null )
@@ -172,7 +174,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
{
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
this.extractAEPower( is, powerPerUse );
return true;
return EnumActionResult.SUCCESS;
}
}
}
@@ -183,7 +185,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
this.cycleColors( is, paintBall, 1 );
}
return false;
return EnumActionResult.FAIL;
}
@Override
@@ -226,7 +226,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
{
if( Platform.hasPermissions( new DimensionalCoord( w, target.getBlockPos() ), p ) )
{
this.onItemUse( item, p, w, target.getBlockPos(), EnumFacing.UP, 0.0F, 0.0F, 0.0F );
this.onItemUse( item, p, w, target.getBlockPos(), hand, EnumFacing.UP, 0.0F, 0.0F, 0.0F );
}
}
}
@@ -236,13 +236,13 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
}
@Override
public boolean onItemUse( final ItemStack item, final EntityPlayer p, final World w, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public EnumActionResult onItemUse( ItemStack item, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
{
if( this.getAECurrentPower( item ) > 1600 )
{
if( !p.canPlayerEdit( pos, side, item ) )
{
return false;
return EnumActionResult.FAIL;
}
final IBlockState state = w.getBlockState( pos );
@@ -254,7 +254,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
{
this.extractAEPower( item, 1600 );
this.cool( state, w, pos );
return true;
return EnumActionResult.SUCCESS;
}
}
else
@@ -263,21 +263,21 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
{
w.setBlockToAir( pos );
( (BlockTNT) blockID ).explode( w, pos, state, p );
return true;
return EnumActionResult.SUCCESS;
}
if( blockID instanceof BlockTinyTNT )
{
w.setBlockToAir( pos );
( (BlockTinyTNT) blockID ).startFuse( w, pos, p );
return true;
return EnumActionResult.SUCCESS;
}
if( this.canHeat( state ) )
{
this.extractAEPower( item, 1600 );
this.heat( state, w, pos );
return true;
return EnumActionResult.SUCCESS;
}
final ItemStack[] stack = Platform.getBlockDrops( w, pos );
@@ -329,7 +329,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
Platform.spawnDrops( w, pos, or.getDrops() );
}
return true;
return EnumActionResult.SUCCESS;
}
else
{
@@ -337,7 +337,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
if( !p.canPlayerEdit( offsetPos, side, item ) )
{
return false;
return EnumActionResult.FAIL;
}
if( w.isAirBlock( offsetPos ) )
@@ -347,11 +347,11 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
w.setBlockState( offsetPos, Blocks.FIRE.getDefaultState() );
}
return true;
return EnumActionResult.SUCCESS;
}
}
}
return false;
return EnumActionResult.PASS;
}
}