Skip to content

Commit

Permalink
nicify XEventHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Jan 10, 2025
1 parent 8d243b6 commit 57d4392
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ public class XEventHandler {
public void onBlockBreak(BreakEvent e) {
if (!e.world.isRemote) {
TileEntity tileentity = e.world.getTileEntity(e.x, e.y, e.z);
if (tileentity instanceof TileEntityStorageCore) {
TileEntityStorageCore core = (TileEntityStorageCore) tileentity;
if (core.inventory.getTotalCount() > 0) {
e.setCanceled(true);
}
if (tileentity instanceof TileEntityStorageCore core && core.inventory.getTotalCount() > 0) {
e.setCanceled(true);
}
}
}
Expand Down

0 comments on commit 57d4392

Please sign in to comment.