Skip to content

Instantly share code, notes, and snippets.

@alesharik
Created August 12, 2015 11:09
Show Gist options
  • Save alesharik/fd5dbddccd9585df49dc to your computer and use it in GitHub Desktop.
Save alesharik/fd5dbddccd9585df49dc to your computer and use it in GitHub Desktop.
package TheBasement.Blocks;
import TheBasement.tile.TileEntityLampBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class LampBlock extends BlockContainer implements cofh.lib.util.position.IRotateableTile {
protected LampBlock(String UnlocalizedName, Material p_i45394_1_) {
super(p_i45394_1_);
this.setBlockName(UnlocalizedName);
this.setHardness(2);
this.setResistance(1);
this.setCreativeTab(CreativeTabs.tabRedstone);
this.setHarvestLevel("picaxe", 1);
this.isBlockContainer = true;
};
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileEntityLampBlock();
}
@Override
public boolean canRotate(){
return true;
}
@Override
public boolean canRotate(ForgeDirection axis) {
// TODO Auto-generated method stub
return false;
}
@Override
public void rotate(ForgeDirection axis) {
// TODO Auto-generated method stub
}
@Override
public void rotateDirectlyTo(int facing) {
// TODO Auto-generated method stub
}
@Override
public ForgeDirection getDirectionFacing() {
// TODO Auto-generated method stub
return null;
};
public void onBlockPreDestroy(World world, int x, int y, int z, int meta)
{
super.onBlockPreDestroy(world,x,y,z,meta);
TileEntityLampBlock tileEntity = (TileEntityLampBlock)world.getTileEntity(x,y,z);
if(tileEntity != null)
tileEntity.onDestroyed();
}
//TileEntity tileentity = world.getTileEntity(x, y, z);
//return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment