Advertisement
Guest User

Untitled

a guest
Jun 16th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. package me.ferdz.placeableitems.tileentity;
  2.  
  3. import net.minecraft.init.Items;
  4. import net.minecraft.item.ItemStack;
  5. import net.minecraft.nbt.NBTTagCompound;
  6. import net.minecraft.tileentity.TileEntity;
  7.  
  8. public class TEArrow extends TileEntity {
  9.  
  10. private ItemStack arrow;
  11.  
  12. public TEArrow() {
  13. arrow = new ItemStack(Items.ARROW);
  14. }
  15.  
  16. public ItemStack getType() {
  17. return this.arrow;
  18. }
  19.  
  20. public void setType(ItemStack arrow) {
  21. this.arrow = arrow;
  22. }
  23.  
  24. @Override
  25. public void readFromNBT(NBTTagCompound nbttagcompound) {
  26. super.readFromNBT(nbttagcompound);
  27. arrow.readFromNBT(nbttagcompound);
  28. }
  29.  
  30. @Override
  31. public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
  32. super.writeToNBT(nbttagcompound);
  33. nbttagcompound = arrow.writeToNBT(nbttagcompound);
  34. return nbttagcompound;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement