diff --git a/pom.xml b/pom.xml index 5601d6d..87c9455 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 nl.rutgerkok.betterenderchest BetterEnderChest - 2.5.1 + 2.5.2-SNAPSHOT BetterEnderChest CraftBukkit plugin that adds functionality for both players and admins to the Ender Chest. https://github.com/rutgerkok/BetterEnderChest @@ -55,13 +55,13 @@ org.spigotmc spigot-api - 1.13-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT provided org.spigotmc spigot - 1.13-pre7-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT provided diff --git a/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java b/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java index 93c1557..474fd95 100644 --- a/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java +++ b/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java @@ -14,30 +14,31 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_13_R1.CraftWorld; -import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_13_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.json.simple.parser.JSONParser; -import net.minecraft.server.v1_13_R1.BlockPosition; -import net.minecraft.server.v1_13_R1.Blocks; -import net.minecraft.server.v1_13_R1.DataConverterRegistry; -import net.minecraft.server.v1_13_R1.DataConverterTypes; -import net.minecraft.server.v1_13_R1.DynamicOpsNBT; -import net.minecraft.server.v1_13_R1.MojangsonParser; -import net.minecraft.server.v1_13_R1.NBTBase; -import net.minecraft.server.v1_13_R1.NBTCompressedStreamTools; -import net.minecraft.server.v1_13_R1.NBTTagByteArray; -import net.minecraft.server.v1_13_R1.NBTTagCompound; -import net.minecraft.server.v1_13_R1.NBTTagDouble; -import net.minecraft.server.v1_13_R1.NBTTagInt; -import net.minecraft.server.v1_13_R1.NBTTagIntArray; -import net.minecraft.server.v1_13_R1.NBTTagList; -import net.minecraft.server.v1_13_R1.NBTTagLong; -import net.minecraft.server.v1_13_R1.NBTTagString; -import net.minecraft.server.v1_13_R1.TileEntity; -import net.minecraft.server.v1_13_R1.TileEntityEnderChest; +import net.minecraft.server.v1_13_R2.BlockPosition; +import net.minecraft.server.v1_13_R2.Blocks; +import net.minecraft.server.v1_13_R2.DataConverterRegistry; +import net.minecraft.server.v1_13_R2.DataConverterTypes; +import net.minecraft.server.v1_13_R2.DynamicOpsNBT; +import net.minecraft.server.v1_13_R2.MojangsonParser; +import net.minecraft.server.v1_13_R2.NBTBase; +import net.minecraft.server.v1_13_R2.NBTCompressedStreamTools; +import net.minecraft.server.v1_13_R2.NBTTagByteArray; +import net.minecraft.server.v1_13_R2.NBTTagCompound; +import net.minecraft.server.v1_13_R2.NBTTagDouble; +import net.minecraft.server.v1_13_R2.NBTTagInt; +import net.minecraft.server.v1_13_R2.NBTTagIntArray; +import net.minecraft.server.v1_13_R2.NBTTagList; +import net.minecraft.server.v1_13_R2.NBTTagLong; +import net.minecraft.server.v1_13_R2.NBTTagString; +import net.minecraft.server.v1_13_R2.TileEntity; +import net.minecraft.server.v1_13_R2.TileEntityEnderChest; + import nl.rutgerkok.betterenderchest.BetterEnderChest; import nl.rutgerkok.betterenderchest.BetterEnderInventoryHolder; import nl.rutgerkok.betterenderchest.ChestRestrictions; @@ -308,7 +309,7 @@ private Inventory loadNBTInventoryFromTag(NBTTagCompound baseTag, ChestOwner che item = updateToLatestMinecraft(item, dataVersion); inventory.setItem(slot, - CraftItemStack.asCraftMirror(net.minecraft.server.v1_13_R1.ItemStack.a(item))); + CraftItemStack.asCraftMirror(net.minecraft.server.v1_13_R2.ItemStack.a(item))); } // Items currently in the chest are what is in the database diff --git a/src/test/java/nl/rutgerkok/betterenderchest/NameableItemStack.java b/src/test/java/nl/rutgerkok/betterenderchest/NameableItemStack.java index e3054a1..a053ff1 100644 --- a/src/test/java/nl/rutgerkok/betterenderchest/NameableItemStack.java +++ b/src/test/java/nl/rutgerkok/betterenderchest/NameableItemStack.java @@ -8,30 +8,36 @@ * Item stack that supports {@link NameableItemMeta}. */ public final class NameableItemStack extends ItemStack { - + private ItemMeta meta = new NameableItemMeta(); public NameableItemStack(ItemStack stack) throws IllegalArgumentException { super(stack); } - public NameableItemStack(Material type, int amount, short damage) { - super(type, amount, damage); + public NameableItemStack(Material type) { + super(type); } public NameableItemStack(Material type, int amount) { super(type, amount); } - public NameableItemStack(Material type) { - super(type); + @Deprecated + public NameableItemStack(Material type, int amount, short damage) { + super(type, amount, damage); } - + @Override public ItemMeta getItemMeta() { return meta.clone(); } - + + @Override + public boolean hasItemMeta() { + return meta.hasDisplayName() || meta.hasLore(); + } + @Override public boolean setItemMeta(ItemMeta meta) { if (meta == null) { @@ -40,10 +46,5 @@ public boolean setItemMeta(ItemMeta meta) { this.meta = meta; return true; } - - @Override - public boolean hasItemMeta() { - return meta.hasDisplayName() || meta.hasLore(); - } } diff --git a/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java b/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java index 9a34a92..1c4f1b3 100644 --- a/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java +++ b/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java @@ -8,7 +8,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import net.minecraft.server.v1_13_R1.NBTTagCompound; +import net.minecraft.server.v1_13_R2.NBTTagCompound; import nl.rutgerkok.betterenderchest.nms.SimpleNMSHandler.JSONSimpleTypes;