Advertisement
Guest User

Untitled

a guest
Jun 16th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
  2. TileEntityHoloStand te = (TileEntityHoloStand) worldIn.getTileEntity(pos);
  3. te.setOwnerUUID(worldIn.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ(), 5, false).getUniqueID());
  4. owner = te.getOwnerUUID();
  5. ....
  6. }
  7.  
  8. package io.ryanshah.mobholo.block.tileentity;
  9.  
  10. import java.util.UUID;
  11.  
  12. import net.minecraft.nbt.NBTTagCompound;
  13. import net.minecraft.tileentity.TileEntity;
  14.  
  15. public class TileEntityHoloStand extends TileEntity
  16. {
  17. protected UUID ownerUUID;
  18.  
  19. public void readFromNBT(NBTTagCompound compound) {
  20. super.readFromNBT(compound);
  21.  
  22. this.ownerUUID = compound.getUniqueId("Owner");
  23. }
  24.  
  25. public NBTTagCompound writeToNBT(NBTTagCompound compound) {
  26. super.writeToNBT(compound);
  27.  
  28. compound.setUniqueId("Owner", ownerUUID);
  29.  
  30. return compound;
  31. }
  32.  
  33. public UUID getOwnerUUID() {
  34. return ownerUUID;
  35. }
  36.  
  37. public void setOwnerUUID(UUID uuid) {
  38. ownerUUID = uuid;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement