TechReborn/src/main/java/techreborn/blocks/BlockQuantumTank.java

37 lines
1.1 KiB
Java
Raw Normal View History

2015-04-11 11:37:47 +02:00
package techreborn.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
2015-11-23 20:37:39 +01:00
import net.minecraft.util.BlockPos;
2015-04-11 11:37:47 +02:00
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileQuantumTank;
2015-04-28 17:18:32 +02:00
public class BlockQuantumTank extends BlockMachineBase {
2015-04-11 11:37:47 +02:00
public BlockQuantumTank() {
super(Material.rock);
2015-11-23 20:19:18 +01:00
setUnlocalizedName("techreborn.quantumTank");
setHardness(2.0F);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileQuantumTank();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
2015-11-23 20:37:39 +01:00
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
2015-11-16 12:17:36 +01:00
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
return true;
}
2015-04-11 11:37:47 +02:00
}