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
@@ -94,11 +94,11 @@ public class BlockChest extends AEBaseTileBlock
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
final TileChest tg = this.getTileEntity( w, pos );
if( tg != null && !p.isShiftKeyDown() )
if( tg != null && !p.isCrouching() )
{
if( Platform.isClient() )
{
return true;
return ActionResultType.SUCCESS;
}
if( hit != tg.getUp() )
@@ -113,9 +113,9 @@ public class BlockChest extends AEBaseTileBlock
}
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
}
@@ -82,9 +82,9 @@ public class BlockDrive 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 TileDrive tg = this.getTileEntity( w, pos );
@@ -94,8 +94,8 @@ public class BlockDrive extends AEBaseTileBlock
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_DRIVE );
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
}
@@ -60,9 +60,9 @@ public class BlockIOPort 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 TileIOPort tg = this.getTileEntity( w, pos );
@@ -72,8 +72,8 @@ public class BlockIOPort extends AEBaseTileBlock
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_IOPORT );
}
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
}