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());
try {
ClientboundBlockEntityDataPacket packet = (ClientboundBlockEntityDataPacket) BLOCK_ENTITY_DATA_PACKET_CONSTRUCTOR.invoke(position, action, ((CompoundTagImpl) compoundTag).toNMSTag());
send(player, packet);
} catch (Throwable ex) {
Debug.echoError(ex);
}
}
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 ImprovedOfflinePlayerImpl method setInventory.
@Override
public void setInventory(org.bukkit.inventory.PlayerInventory inventory) {
CraftInventoryPlayer inv = (CraftInventoryPlayer) inventory;
net.minecraft.nbt.CompoundTag nbtTagCompound = ((CompoundTagImpl) compound).toNMSTag();
nbtTagCompound.put("Inventory", inv.getInventory().save(new ListTag()));
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 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 setInventory.
@Override
public void setInventory(org.bukkit.inventory.PlayerInventory inventory) {
CraftInventoryPlayer inv = (CraftInventoryPlayer) inventory;
net.minecraft.nbt.CompoundTag nbtTagCompound = ((CompoundTagImpl) compound).toNMSTag();
nbtTagCompound.put("Inventory", inv.getInventory().save(new ListTag()));
this.compound = CompoundTagImpl.fromNMSTag(nbtTagCompound);
if (this.autosave) {
savePlayerData();
}
}
Aggregations