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

57 lines
1.6 KiB
Java
Raw Normal View History

2015-04-11 11:37:47 +02:00
package techreborn.blocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
2015-04-11 18:20:53 +02:00
import net.minecraft.client.renderer.texture.IIconRegister;
2015-04-11 11:37:47 +02:00
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
2015-04-11 18:20:53 +02:00
import net.minecraft.util.IIcon;
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-12 21:04:12 +02:00
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
2015-04-11 11:37:47 +02:00
public class BlockQuantumTank extends BlockContainer {
2015-04-11 18:20:53 +02:00
@SideOnly(Side.CLIENT)
private IIcon top;
@SideOnly(Side.CLIENT)
private IIcon other;
2015-04-11 11:37:47 +02:00
public BlockQuantumTank() {
super(Material.piston);
2015-04-11 17:21:24 +02:00
setHardness(2f);
2015-04-11 11:37:47 +02:00
}
@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) {
if(!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
2015-04-11 11:37:47 +02:00
return true;
}
2015-04-11 18:20:53 +02:00
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon) {
2015-04-14 17:21:23 +02:00
top = icon.registerIcon("techreborn:machine/quantum_top");
other = icon.registerIcon("techreborn:machine/ThermalGenerator_other");
2015-04-11 18:20:53 +02:00
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int currentSide, int meta) {
if (currentSide == 1) {
return top;
} else {
return other;
}
}
2015-04-11 11:37:47 +02:00
}