Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package io.github.hedgehog1029.mariopipe;
- import net.minecraft.block.BlockContainer;
- import net.minecraft.block.material.Material;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- import net.minecraftforge.client.IItemRenderer;
- import net.minecraftforge.client.IItemRenderer.ItemRenderType;
- public class TileEntityMarioPipeBlock extends BlockContainer {
- //Treat it like a normal block here. The Block Bounds are a good idea - the first three are X Y and Z of the botton-left corner,
- //And the second three are the top-right corner.
- public TileEntityMarioPipeBlock() {
- super(Material.iron);
- this.setCreativeTab(CreativeTabs.tabTransport);
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.1F, 1.0F);
- this.setBlockName("mariopipe:marioPipe");
- }
- //Make sure you set this as your TileEntity class relevant for the block!
- @Override
- public TileEntity createNewTileEntity(World world, int var2) {
- return new TileEntityMarioPipe();
- }
- //You don't want the normal render type, or it wont render properly.
- @Override
- public int getRenderType() {
- return -1;
- }
- //It's not an opaque cube, so you need this.
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
- //It's not a normal block, so you need this too.
- public boolean renderAsNormalBlock() {
- return false;
- }
- //This is the icon to use for showing the block in your hand.
- public void registerIcons(IIconRegister icon) {
- this.blockIcon = icon.registerIcon("mariopipe:MarioPipeIcon");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement