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
@@ -48,9 +48,9 @@ public class BlockCellWorkbench extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
final TileCellWorkbench tg = this.getTileEntity( w, pos );
@@ -60,8 +60,8 @@ public class BlockCellWorkbench extends AEBaseTileBlock
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CELL_WORKBENCH );
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
}
@@ -75,9 +75,9 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
if( player.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
if( Platform.isServer() )
@@ -89,7 +89,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
}
return true;
return ActionResultType.SUCCESS;
}
@Override
@@ -48,21 +48,21 @@ public class BlockCondenser extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
if( player.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
if( Platform.isServer() )
{
final TileCondenser tc = this.getTileEntity( w, pos );
if( tc != null && !player.isShiftKeyDown() )
if( tc != null && !player.isCrouching() )
{
Platform.openGUI( player, tc, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CONDENSER );
return true;
return ActionResultType.SUCCESS;
}
}
return true;
return ActionResultType.SUCCESS;
}
}
@@ -53,9 +53,9 @@ public class BlockInscriber extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
final TileInscriber tg = this.getTileEntity( w, pos );
@@ -65,9 +65,9 @@ public class BlockInscriber extends AEBaseTileBlock
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_INSCRIBER );
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
@Override
@@ -77,9 +77,9 @@ public class BlockInterface extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
final TileInterface tg = this.getTileEntity( w, pos );
@@ -89,9 +89,9 @@ public class BlockInterface extends AEBaseTileBlock
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_INTERFACE );
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
@Override
@@ -83,9 +83,9 @@ public class BlockSecurityStation extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
if( p.isCrouching() )
{
return false;
return ActionResultType.PASS;
}
final TileSecurityStation tg = this.getTileEntity( w, pos );
@@ -93,12 +93,12 @@ public class BlockSecurityStation extends AEBaseTileBlock
{
if( Platform.isClient() )
{
return true;
return ActionResultType.SUCCESS;
}
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_SECURITY );
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
}
@@ -81,7 +81,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.startFuse( w, pos, player );
w.removeBlock(pos, false);
heldItem.damageItem( 1, player );
return true;
return ActionResultType.SUCCESS;
}
else
{
@@ -79,7 +79,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
@Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
if( player.isCrouching() )
{
return false;
}
@@ -87,14 +87,14 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
if( Platform.isServer() )
{
final TileVibrationChamber tc = this.getTileEntity( w, pos );
if( tc != null && !player.isShiftKeyDown() )
if( tc != null && !player.isCrouching() )
{
Platform.openGUI( player, tc, AEPartLocation.fromFacing(hit), GuiBridge.GUI_VIBRATION_CHAMBER );
return true;
return ActionResultType.SUCCESS;
}
}
return true;
return ActionResultType.SUCCESS;
}
@Override