Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class energyBlock extends BlockContainer {
- public World world1;
- public int x1;
- public int y1;
- public int z1;
- public energyBlock(){
- super(Material.iron);
- }
- @Override
- public int getLightValue(IBlockAccess world, int x, int y, int z) {
- if (world1 != null){
- light te = (light)world1.getTileEntity(x1, y1, z1);
- if (te.energy > 0.0D){
- te.energy = te.energy - 100;
- return 15;
- }else{
- return 0;
- }
- }else{
- return 0;
- }
- }
- @Override
- public boolean onBlockActivated(World world, int x,
- int y, int z, EntityPlayer player,
- int p_149727_6_, float p_149727_7_, float p_149727_8_,
- float p_149727_9_) {
- if(world.isRemote)return true;
- world1 = world;
- x1 = x;
- y1 = y;
- z1 = z;
- light te = (light)world.getTileEntity(x, y, z);
- if(te != null){
- if(player.isSneaking())te.energy=0.0D;
- player.addChatMessage(new ChatComponentText(te.energy+"EU"));
- }
- return true;
- }
- @Override
- public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
- // TODO Auto-generated method stub
- return new light();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement