Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
- TileEntityHoloStand te = (TileEntityHoloStand) worldIn.getTileEntity(pos);
- te.setOwnerUUID(worldIn.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ(), 5, false).getUniqueID());
- owner = te.getOwnerUUID();
- ....
- }
- package io.ryanshah.mobholo.block.tileentity;
- import java.util.UUID;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- public class TileEntityHoloStand extends TileEntity
- {
- protected UUID ownerUUID;
- public void readFromNBT(NBTTagCompound compound) {
- super.readFromNBT(compound);
- this.ownerUUID = compound.getUniqueId("Owner");
- }
- public NBTTagCompound writeToNBT(NBTTagCompound compound) {
- super.writeToNBT(compound);
- compound.setUniqueId("Owner", ownerUUID);
- return compound;
- }
- public UUID getOwnerUUID() {
- return ownerUUID;
- }
- public void setOwnerUUID(UUID uuid) {
- ownerUUID = uuid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement