mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Simplify press click handling
Turns out there is already a function for doing just that
This commit is contained in:
parent
d1f50a8eb4
commit
d1497abd1e
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user