85 lines
2.5 KiB
Java
85 lines
2.5 KiB
Java
package fr.jackcartersmith.ob.blocks;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.BlockContainer;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.world.IBlockAccess;
|
|
import net.minecraft.world.World;
|
|
|
|
public class DefLasBlock extends BlockContainer
|
|
{
|
|
public DefLasBlock(Material par2Material)
|
|
{
|
|
super(par2Material);
|
|
}
|
|
|
|
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
|
{
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 1000.0F, 0.0F);
|
|
}
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
/**
|
|
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
* is the only chance you get to register icons.
|
|
*/
|
|
public void registerIcons(IIconRegister icon) {}
|
|
|
|
/**
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
@Override
|
|
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
|
return new DefenderLaserTileEntity();
|
|
}
|
|
@Override
|
|
public boolean hasTileEntity(int metadata)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
|
* metadata
|
|
*/
|
|
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
|
{
|
|
par1World.removeTileEntity(par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
@Override
|
|
public int getRenderType()
|
|
{
|
|
return ClientProxy.tesrRenderId;
|
|
}
|
|
|
|
/**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
@Override
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
|
*/
|
|
@Override
|
|
public boolean renderAsNormalBlock()
|
|
{
|
|
return false;
|
|
}
|
|
}
|