ActionResultType in onActivated

This commit is contained in:
Sebastian Hartte
2020-06-02 19:15:23 +02:00
parent 3e78c713d1
commit cf9ab8a13b
42 changed files with 135 additions and 181 deletions
@@ -57,7 +57,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
@Override
public ActionResult<ItemStack> onItemRightClick( final World w, final PlayerEntity p, final Hand hand )
{
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
this.encode( p.getHeldItem( hand ), p );
p.swingArm( hand );
@@ -70,7 +70,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
@Override
public boolean itemInteractionForEntity( ItemStack is, final PlayerEntity player, final LivingEntity target, final Hand hand )
{
if( target instanceof PlayerEntity && !player.isShiftKeyDown() )
if( target instanceof PlayerEntity && !player.isCrouching() )
{
if( player.isCreative() )
{
@@ -198,7 +198,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
@Override
public ActionResultType onItemUse( ItemUseContext context )
{
if( context.getPlayer().isShiftKeyDown() )
if( context.getPlayer().isCrouching() )
{
if( !context.getPlayer().world.isRemote )
{
@@ -215,7 +215,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
@Override
public ActionResult<ItemStack> onItemRightClick( World w, PlayerEntity player, Hand hand )
{
if( player.isShiftKeyDown() )
if( player.isCrouching() )
{
if( !w.isRemote )
{
@@ -103,7 +103,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
{
return ActionResultType.FAIL;
}
else if( context.getPlayer().isShiftKeyDown() )
else if( context.getPlayer().isCrouching() )
{
return ActionResultType.PASS;
}
@@ -138,7 +138,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
}
final Block b = w.getBlockState( pos ).getBlock();
if( !p.isShiftKeyDown() )
if( !p.isCrouching() )
{
final TileEntity te = w.getTileEntity( pos );
if( !( te instanceof IGridHost ) )
@@ -152,7 +152,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
}
}
if( !p.isShiftKeyDown() )
if( !p.isCrouching() )
{
if( p.openContainer instanceof AEBaseContainer )
{
@@ -188,7 +188,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
}
}
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
this.cycleColors( is, paintBall, 1 );
}
@@ -256,7 +256,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
final BlockState state = w.getBlockState( pos );
final Block blockID = state.getBlock();
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
if( this.canCool( state ) )
{