Guest User

Untitled

a guest
Jul 29th, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. package org.freefourms.geforce.securitycraft.tileentity;
  2.  
  3. import net.minecraft.nbt.NBTTagCompound;
  4. import net.minecraft.tileentity.TileEntityChest;
  5.  
  6. public class TileEntityKeypadChest extends TileEntityChest{
  7.  
  8. private int passcode;
  9.  
  10.  
  11. public int getKeypadCode(){
  12. return passcode;
  13. }
  14.  
  15. public void setKeypadCode(int par1){
  16. passcode = par1;
  17. }
  18.  
  19. /**
  20. * Writes a tile entity to NBT.
  21. */
  22. public void writeToNBT(NBTTagCompound par1NBTTagCompound)
  23. {
  24. super.writeToNBT(par1NBTTagCompound);
  25. par1NBTTagCompound.setInteger("passcode", this.passcode);
  26. }
  27.  
  28. /**
  29. * Reads a tile entity from NBT.
  30. */
  31. public void readFromNBT(NBTTagCompound par1NBTTagCompound)
  32. {
  33. super.readFromNBT(par1NBTTagCompound);
  34.  
  35. if (par1NBTTagCompound.hasKey("passcode"))
  36. {
  37. this.passcode = par1NBTTagCompound.getInteger("passcode");
  38. }
  39. }
  40.  
  41. /**
  42. * Returns the name of the inventory
  43. */
  44. public String getInventoryName()
  45. {
  46. return "Protected chest";
  47. }
  48.  
  49. /**
  50. * Performs the check for adjacent chests to determine if this chest is double or not.
  51. */
  52. @Override
  53. public void checkForAdjacentChests() {
  54.  
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment