Advertisement
Guest User

Tile Entity

a guest
Feb 25th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package net.roadcraft.mod.tileentity;
  2.  
  3. import net.minecraft.nbt.NBTTagCompound;
  4. import net.minecraft.tileentity.TileEntity;
  5.  
  6. public class TileEntityVerticalTrafficLight extends TileEntity
  7. {  
  8.     private int power;
  9.    
  10.     public TileEntityVerticalTrafficLight()
  11.     {
  12.         this.setPower(0);
  13.     }
  14.    
  15.     public int getPower()
  16.     {
  17.         return power;
  18.     }
  19.  
  20.     public void setPower(int ticksExisted)
  21.     {
  22.         power = ticksExisted;
  23.     }
  24.  
  25.     @Override
  26.     public void readFromNBT(NBTTagCompound nbttagcompound) {
  27.         super.readFromNBT(nbttagcompound);
  28.         power = nbttagcompound.getInteger("power");
  29.     }
  30.  
  31.     @Override
  32.     public void writeToNBT(NBTTagCompound nbttagcompound) {
  33.         super.writeToNBT(nbttagcompound);
  34.         nbttagcompound.setInteger("power", this.power);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement