use of com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayerImpl method setInventory.
@Override
public void setInventory(org.bukkit.inventory.PlayerInventory inventory) {
CraftInventoryPlayer inv = (CraftInventoryPlayer) inventory;
NBTTagCompound nbtTagCompound = ((CompoundTagImpl) compound).toNMSTag();
nbtTagCompound.set("Inventory", inv.getInventory().a(new NBTTagList()));
this.compound = CompoundTagImpl.fromNMSTag(nbtTagCompound);
if (this.autosave) {
savePlayerData();
}
}
use of com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayerImpl method getEnderChest.
@Override
public Inventory getEnderChest() {
if (offlineEnderChests.containsKey(getUniqueId())) {
return offlineEnderChests.get(getUniqueId());
}
InventoryEnderChest endchest = new InventoryEnderChest(null);
endchest.a(((CompoundTagImpl) this.compound).toNMSTag().getList("EnderItems", 10));
org.bukkit.inventory.Inventory inv = new CraftInventory(endchest);
offlineEnderChests.put(getUniqueId(), inv);
return inv;
}
use of com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayerImpl method getAttributes.
private AttributeMap getAttributes() {
AttributeMap amb = new AttributeMap(DefaultAttributes.getSupplier(net.minecraft.world.entity.EntityType.PLAYER));
amb.load(((CompoundTagImpl) this.compound).toNMSTag().getList("Attributes", 10));
return amb;
}
use of com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayerImpl method getEnderChest.
@Override
public Inventory getEnderChest() {
if (offlineEnderChests.containsKey(getUniqueId())) {
return offlineEnderChests.get(getUniqueId());
}
PlayerEnderChestContainer endchest = new PlayerEnderChestContainer(null);
endchest.fromTag(((CompoundTagImpl) this.compound).toNMSTag().getList("EnderItems", 10));
org.bukkit.inventory.Inventory inv = new CraftInventory(endchest);
offlineEnderChests.put(getUniqueId(), inv);
return inv;
}
use of com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelperImpl method showTileEntityData.
@Override
public void showTileEntityData(Player player, Location location, int action, CompoundTag compoundTag) {
BlockPos position = new BlockPos(location.getX(), location.getY(), location.getZ());
send(player, new ClientboundBlockEntityDataPacket(position, action, ((CompoundTagImpl) compoundTag).toNMSTag()));
}
Aggregations