diff --git a/.gitignore b/.gitignore
index 1b0f1ae..4d068b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,8 @@ local.properties
.classpath
.settings/
.loadpath
+.idea/
+BetterEnderChest.iml
# Locally stored "Eclipse launch configurations"
*.launch
@@ -44,3 +46,4 @@ Desktop.ini
# Mac crap
.DS_Store
+
diff --git a/pom.xml b/pom.xml
index 490c0e4..2f7928c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
nl.rutgerkok.betterenderchest
BetterEnderChest
- 2.4.5-SNAPSHOT
+ 2.4.5
BetterEnderChest
CraftBukkit plugin that adds functionality for both players and admins to the Ender Chest.
https://github.com/rutgerkok/BetterEnderChest
@@ -54,13 +54,13 @@
org.spigotmc
spigot-api
- 1.10.2-R0.1-SNAPSHOT
+ 1.11-R0.1-SNAPSHOT
provided
org.spigotmc
spigot
- 1.10.2-R0.1-SNAPSHOT
+ 1.11-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 0268be3..2b8e839 100644
--- a/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java
+++ b/src/main/java/nl/rutgerkok/betterenderchest/nms/SimpleNMSHandler.java
@@ -19,8 +19,8 @@
import org.bukkit.Location;
import org.bukkit.Material;
-import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.v1_11_R1.CraftWorld;
+import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.json.simple.JSONObject;
@@ -28,23 +28,23 @@
import com.google.common.collect.ImmutableMap;
-import net.minecraft.server.v1_10_R1.BlockPosition;
-import net.minecraft.server.v1_10_R1.Blocks;
-import net.minecraft.server.v1_10_R1.NBTBase;
-import net.minecraft.server.v1_10_R1.NBTCompressedStreamTools;
-import net.minecraft.server.v1_10_R1.NBTTagByte;
-import net.minecraft.server.v1_10_R1.NBTTagByteArray;
-import net.minecraft.server.v1_10_R1.NBTTagCompound;
-import net.minecraft.server.v1_10_R1.NBTTagDouble;
-import net.minecraft.server.v1_10_R1.NBTTagFloat;
-import net.minecraft.server.v1_10_R1.NBTTagInt;
-import net.minecraft.server.v1_10_R1.NBTTagIntArray;
-import net.minecraft.server.v1_10_R1.NBTTagList;
-import net.minecraft.server.v1_10_R1.NBTTagLong;
-import net.minecraft.server.v1_10_R1.NBTTagShort;
-import net.minecraft.server.v1_10_R1.NBTTagString;
-import net.minecraft.server.v1_10_R1.TileEntity;
-import net.minecraft.server.v1_10_R1.TileEntityEnderChest;
+import net.minecraft.server.v1_11_R1.BlockPosition;
+import net.minecraft.server.v1_11_R1.Blocks;
+import net.minecraft.server.v1_11_R1.NBTBase;
+import net.minecraft.server.v1_11_R1.NBTCompressedStreamTools;
+import net.minecraft.server.v1_11_R1.NBTTagByte;
+import net.minecraft.server.v1_11_R1.NBTTagByteArray;
+import net.minecraft.server.v1_11_R1.NBTTagCompound;
+import net.minecraft.server.v1_11_R1.NBTTagDouble;
+import net.minecraft.server.v1_11_R1.NBTTagFloat;
+import net.minecraft.server.v1_11_R1.NBTTagInt;
+import net.minecraft.server.v1_11_R1.NBTTagIntArray;
+import net.minecraft.server.v1_11_R1.NBTTagList;
+import net.minecraft.server.v1_11_R1.NBTTagLong;
+import net.minecraft.server.v1_11_R1.NBTTagShort;
+import net.minecraft.server.v1_11_R1.NBTTagString;
+import net.minecraft.server.v1_11_R1.TileEntity;
+import net.minecraft.server.v1_11_R1.TileEntityEnderChest;
public class SimpleNMSHandler extends NMSHandler {
static class JSONSimpleTypes {
@@ -58,7 +58,7 @@ static class JSONSimpleTypes {
/**
* Boxes all the values of the array for consumption by JSONSimple.
- *
+ *
* @param byteArray
* Array to box.
* @return The boxed array.
@@ -73,7 +73,7 @@ private static final List boxBytes(byte[] byteArray) {
/**
* Boxes all the values of the array for consumption by JSONSimple.
- *
+ *
* @param intArray
* Array to box.
* @return The boxed array.
@@ -179,7 +179,7 @@ private static final Object nbtTagToJavaType(NBTBase tag) throws IOException {
byte value = ((NBTTagByte) tag).g();
return value;
} else if (tag instanceof NBTTagDouble) {
- double value = ((NBTTagDouble) tag).h();
+ double value = ((NBTTagDouble) tag).asDouble();
return value;
} else if (tag instanceof NBTTagFloat) {
float value = ((NBTTagFloat) tag).i();
@@ -209,7 +209,7 @@ private static final Object nbtTagToJavaType(NBTBase tag) throws IOException {
/**
* Converts the object at the specified position in the list to a Map,
* List, double, float or String.
- *
+ *
* @param tagList
* The list to convert an element from.
* @param position
@@ -241,7 +241,7 @@ private static final Object tagInNBTListToJavaType(NBTTagList tagList, int posit
/**
* Converts the compound tag to a map. All values in the tag will also
* have their tags converted to String//primitives/maps/Lists.
- *
+ *
* @param tagCompound
* The compound tag.
* @return The map.
@@ -263,7 +263,7 @@ static final Map toMap(NBTTagCompound tagCompound) throws IOExce
/**
* Turns the given json-formatted string back into a NBTTagCompound.
* Mojangson formatting is also accepted.
- *
+ *
* @param jsonString
* The json string to parse.
* @return The parsed json string.
@@ -426,7 +426,7 @@ private Inventory loadNBTInventoryFromTag(NBTTagCompound baseTag, ChestOwner che
NBTTagCompound item = inventoryTag.get(i);
int slot = item.getByte("Slot") & 255;
inventory.setItem(slot,
- CraftItemStack.asCraftMirror(net.minecraft.server.v1_10_R1.ItemStack.createStack(item)));
+ CraftItemStack.asCraftMirror(new net.minecraft.server.v1_11_R1.ItemStack(item)));
}
// Return the inventory
@@ -438,7 +438,7 @@ public void openEnderChest(Location loc) {
BlockPosition blockPos = toBlockPosition(loc);
TileEntity tileEntity = ((CraftWorld) loc.getWorld()).getHandle().getTileEntity(blockPos);
if (tileEntity instanceof TileEntityEnderChest) {
- ((TileEntityEnderChest) tileEntity).d(); // .open()
+ ((TileEntityEnderChest) tileEntity).a(); // .open()
}
}
diff --git a/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java b/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java
index 3b41ab5..7abd0d3 100644
--- a/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java
+++ b/src/test/java/nl/rutgerkok/betterenderchest/nms/TestJSON.java
@@ -12,7 +12,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import net.minecraft.server.v1_10_R1.NBTTagCompound;
+import net.minecraft.server.v1_11_R1.NBTTagCompound;
@RunWith(JUnit4.class)
public class TestJSON {