This commit is contained in:
Modmuss50 2015-11-16 11:17:36 +00:00
parent 25b5715ab8
commit 19d269b1de
24 changed files with 38 additions and 34 deletions

View file

@ -204,10 +204,10 @@ public class BlockMachineBase extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) {
if(super.onBlockActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ)){
if(fillBlockWithFluid(world, x, y, z, entityplayer, side, hitX, hitY, hitZ)){
return true;
}
return fillBlockWithFluid(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
return super.onBlockActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
}
public boolean fillBlockWithFluid(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) {

View file

@ -32,6 +32,9 @@ public class BlockQuantumTank extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
return true;

View file

@ -46,6 +46,9 @@ public class BlockDieselGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockGasTurbine extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockSemiFluidGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockThermalGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y,
z);

View file

@ -44,6 +44,9 @@ public class BlockGrinder extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y,
z);

View file

@ -41,6 +41,9 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y,
z);