Skip to content

Instantly share code, notes, and snippets.

@izzyaxel
Created February 16, 2016 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izzyaxel/3c2d65fa0c30544e28ab to your computer and use it in GitHub Desktop.
Save izzyaxel/3c2d65fa0c30544e28ab to your computer and use it in GitHub Desktop.
The Block for the 'black hole' type of block
public class BlockBlackHole extends BlockContainer
{
public BlockBlackHole()
{
super(Material.glass);
this.setBlockName("blackHole");
this.setHardness(1.0F);
this.setResistance(1.0F);
this.setBlockTextureName(YourModID + ":" + getUnlocalizedName().substring(5));
this.setHarvestLevel("pickaxe", 1);
}
//Create a tile entity for this block to do all the logic in
@Override
public TileEntity createNewTileEntity(World world, int id)
{
return new TEBlackHole();
}
//Make the block intangible by not adding anything to the list
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity){}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment