Guest User

TardisBlock

a guest
Apr 9th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.88 KB | None | 0 0
  1. package net.DoctorWhoAdventures.superhb.mod.TARDIS;
  2.  
  3. import java.util.List;
  4.  
  5. import org.lwjgl.opengl.GL11;
  6.  
  7. import cpw.mods.fml.client.FMLClientHandler;
  8. import cpw.mods.fml.relauncher.Side;
  9. import cpw.mods.fml.relauncher.SideOnly;
  10. import net.DoctorWhoAdventures.superhb.mod.DoctorWhoAdventure;
  11. import net.minecraft.block.Block;
  12. import net.minecraft.block.BlockContainer;
  13. import net.minecraft.block.ITileEntityProvider;
  14. import net.minecraft.block.material.Material;
  15. import net.minecraft.client.Minecraft;
  16. import net.minecraft.client.renderer.texture.IconRegister;
  17. import net.minecraft.entity.Entity;
  18. import net.minecraft.entity.player.EntityPlayer;
  19. import net.minecraft.tileentity.TileEntity;
  20. import net.minecraft.util.AABBPool;
  21. import net.minecraft.util.AxisAlignedBB;
  22. import net.minecraft.util.ResourceLocation;
  23. import net.minecraft.world.IBlockAccess;
  24. import net.minecraft.world.World;
  25. import net.minecraftforge.client.model.AdvancedModelLoader;
  26. import net.minecraftforge.client.model.IModelCustom;
  27. import net.minecraftforge.common.MinecraftForge;
  28.  
  29. public class BlockEleventhTardis extends Block
  30. {
  31.    
  32.     private IModelCustom EleventhTardis;
  33.    
  34.     public BlockEleventhTardis(int i, Material m)
  35.     {
  36.         super(i, m);
  37.  
  38.         setHardness(3.5F);
  39.         setStepSound(Block.soundStoneFootstep);
  40.         setCreativeTab(DoctorWhoAdventure.tabDoctorWho);
  41.         setResistance(1000.0F);
  42.         setResistance(1000.0F);
  43.         setHardness(1.5F);
  44.         setLightOpacity(0);
  45.         setLightValue(0.0f);
  46.         setTickRandomly(false);
  47.         setUnlocalizedName("dwadventure:EleventhTardis");
  48.        
  49.      // Harvest level for this block. par2 can be pickaxe, axe, or shovel, or
  50.         // a different toolclass. par3 is the minimum level of item required to
  51.         // break it:
  52.         // 0=bare hands, 1=wood, 2=stone, 3=iron, 4=diamond
  53.         //ItemSonicScrewdriver.setBlockHarvestLevel(this, "sonic", 0);
  54.     }
  55.    
  56.     @SideOnly(Side.CLIENT)
  57.     public void registerIcons(IconRegister par1IconRegister)
  58.  
  59.         {
  60.             blockIcon = par1IconRegister.registerIcon("dwadventures:EleventhTARDIS");
  61.         }
  62.    
  63.     /**
  64.      * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
  65.      * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
  66.      */
  67.     @Override
  68.     public boolean isOpaqueCube()
  69.     {
  70.         return false;
  71.     }
  72.    
  73.     @Override
  74.     public boolean isCollidable()
  75.     {
  76.         return true;
  77.     }
  78.    
  79.     /**
  80.      * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
  81.      */
  82.     @Override
  83.     public boolean renderAsNormalBlock()
  84.     {
  85.         return false;
  86.     }
  87.        
  88.     /**
  89.      * Returns Returns true if the given side of this block type should be
  90.      * rendered (if it's solid or not), if the adjacent block is at the given
  91.      * coordinates. Args: blockAccess, x, y, z, side
  92.      */
  93.     @Override
  94.     public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
  95.     {
  96.             return true;
  97.     }
  98.    
  99.     //Block Bounds
  100.     public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
  101.     {
  102.     this.setBlockBounds(0F, 0F, 0F, 0F, 0F, 0F);
  103.     super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
  104.     this.setBlockBounds(0F, 0F, 0F, 0.625F, 0F, 0F);
  105.     super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
  106.     this.setBlockBounds(0F, 0F, 0F, 2F, 2F, 2F);
  107.     super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
  108.     this.setBlockBounds(0F, 0F, 0F, 1.111F, 1F, 1.111F);
  109.     }
  110.    
  111.     /**
  112.      * This method is called on a block after all other blocks gets already
  113.      * created. You can use it to reference and configure something on the block
  114.      * that needs the others ones.
  115.      */
  116.     @Override
  117.     protected void initializeBlock()
  118.     {
  119.        
  120.     }
  121.    
  122.     /**
  123.      * Called throughout the code as a replacement for block instanceof
  124.      * BlockContainer Moving this to the Block base class allows for mods that
  125.      * wish
  126.      * to extend vinella blocks, and also want to have a tile entity on that
  127.      * block, may.
  128.      *
  129.      * Return true from this function to specify this block has a tile entity.
  130.      *
  131.      * @param metadata
  132.      *            Metadata of the current block
  133.      * @return True if block has a tile entity, false otherwise
  134.      */
  135.     @Override
  136.     public boolean hasTileEntity(int metadata) {
  137.             return true;
  138.     }
  139.    
  140.     @Override
  141.     public TileEntity createTileEntity(World world, int metadata)
  142.     {
  143.         return new TileEntityTardis();
  144.     }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment