Simplify press click handling

Turns out there is already a function for doing just that
This commit is contained in:
abel1502 2025-06-29 23:40:51 +03:00
parent d1f50a8eb4
commit d1497abd1e
No known key found for this signature in database
GPG Key ID: 076926596A536338
2 changed files with 2 additions and 32 deletions

View File

@ -59,21 +59,6 @@ public class MachineEPress extends BlockDummyable {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return false;
TileEntityMachineEPress entity = (TileEntityMachineEPress) world.getTileEntity(pos[0], pos[1], pos[2]);
if(entity == null)
return false;
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
return true;
} else {
return false;
}
return this.standardOpenBehavior(world, x, y, z, player, 0);
}
}

View File

@ -43,21 +43,6 @@ public class MachinePress extends BlockDummyable {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return false;
TileEntityMachinePress entity = (TileEntityMachinePress) world.getTileEntity(pos[0], pos[1], pos[2]);
if(entity == null)
return false;
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
return true;
} else {
return false;
}
return this.standardOpenBehavior(world, x, y, z, player, 0);
}
}