Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. package com.nextlevelminecraft.cad435.objloader.ColoredLamp;
  2.  
  3. import com.nextlevelminecraft.cad435.TNL_Client_Dependencies.libs.RGBVec;
  4. import net.minecraft.nbt.NBTTagCompound;
  5. import net.minecraft.tileentity.TileEntity;
  6.  
  7. /**
  8.  * Created by Alexander on 24.01.2015.
  9.  */
  10. public class LampTileEntity extends TileEntity {
  11.  
  12.  
  13.     RGBVec RGB_VALUES = new RGBVec("255:255:255");
  14.  
  15.  
  16.     @Override
  17.     public void writeToNBT(NBTTagCompound var1) {
  18.         var1.setIntArray("RGB_VALUE", RGB_VALUES.toIntArray());
  19.         super.writeToNBT(var1);
  20.     }
  21.  
  22.     @Override
  23.     public void readFromNBT(NBTTagCompound var1)
  24.     {
  25.         try {
  26.  
  27.             RGB_VALUES = new RGBVec(var1.getIntArray("RGB_VALUE"));
  28.             super.readFromNBT(var1);
  29.         }
  30.         catch (Exception e)
  31.         {
  32.             System.out.println("Found an empty Lamp...");
  33.             RGB_VALUES = new RGBVec("255:255:255");
  34.             super.readFromNBT(var1);
  35.         }
  36.     }
  37.  
  38.     public void setRGB_VALUES(RGBVec vec)
  39.     {
  40.         RGB_VALUES = vec;
  41.     }
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement