Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BlockThaumicGen extends BlockContainer { // implements IWandable {
- private String name = "thaumicgen";
- @SideOnly(Side.CLIENT)
- private IIcon side;
- @SideOnly(Side.CLIENT)
- private IIcon front;
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister reg) {
- this.blockIcon = reg.registerIcon(Knowledge.MODID+":"+ name + "_def");
- this.front = reg.registerIcon(Knowledge.MODID+":"+name+"_front");
- this.side = reg.registerIcon(Knowledge.MODID+":"+name+"_side");
- }
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int side, int meta) {
- ForgeDirection opp = ForgeDirection.getOrientation(meta).getOpposite();
- ForgeDirection s = ForgeDirection.getOrientation(side);
- if (side == 0 || side == 1 || s == opp) {
- return this.blockIcon;
- }
- else if (side == meta) {
- return this.front;
- }
- else return this.side;
- }
- public BlockThaumicGen() {
- super(Material.rock);
- this.setCreativeTab(Knowledge.tab).setBlockName(Knowledge.MODID+"_"+name);
- this.setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypeStone);
- this.setHarvestLevel("pickaxe", 0);
- this.setTickRandomly(true);
- }
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entity, ItemStack item)
- {
- int l = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
- if (l == 0)
- {
- world.setBlockMetadataWithNotify(i, j, k, 2, 2);
- }
- if (l == 1)
- {
- world.setBlockMetadataWithNotify(i, j, k, 5, 2);
- }
- if (l == 2)
- {
- world.setBlockMetadataWithNotify(i, j, k, 3, 2);
- }
- if (l == 3)
- {
- world.setBlockMetadataWithNotify(i, j, k, 4, 2);
- }
- }
- public Item getItemDropped() {
- return Item.getItemFromBlock(this);
- }
- @Override
- public TileEntity createNewTileEntity(World world, int metadata) {
- return new TileEntityThaumicGen();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement