Search in sources :

Example 6 with CraftInventoryPlayer

use of org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryPlayer in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayer_v1_10_R1 method setInventory.

@Override
public void setInventory(org.bukkit.inventory.PlayerInventory inventory) {
    CraftInventoryPlayer inv = (CraftInventoryPlayer) inventory;
    NBTTagCompound nbtTagCompound = ((CompoundTag_v1_10_R1) compound).toNMSTag();
    nbtTagCompound.set("Inventory", inv.getInventory().a(new NBTTagList()));
    this.compound = CompoundTag_v1_10_R1.fromNMSTag(nbtTagCompound);
    if (this.autosave) {
        savePlayerData();
    }
}
Also used : CraftInventoryPlayer(org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventoryPlayer) CompoundTag_v1_10_R1(net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_10_R1)

Example 7 with CraftInventoryPlayer

use of org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryPlayer 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();
    }
}
Also used : CraftInventoryPlayer(org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryPlayer) ListTag(net.minecraft.nbt.ListTag) CompoundTagImpl(com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)

Aggregations

ListTag (net.minecraft.nbt.ListTag)2 CompoundTagImpl (com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl)1 CompoundTagImpl (com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)1 CompoundTagImpl (com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl)1 CompoundTag_v1_10_R1 (net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_10_R1)1 CompoundTag_v1_11_R1 (net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_11_R1)1 CompoundTag_v1_8_R3 (net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_8_R3)1 CompoundTag_v1_9_R2 (net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_9_R2)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryPlayer)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_9_R2.inventory.CraftInventoryPlayer)1