summaryrefslogtreecommitdiffstats
path: root/nms-patches/ContainerAnvil.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
committermd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
commitc25ddf063a808e3adb749e22017661f403c5fb7e (patch)
treeb2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/ContainerAnvil.patch
parent51263e97187a84338f89698eef187284055a682a (diff)
downloadcraftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/ContainerAnvil.patch')
-rw-r--r--nms-patches/ContainerAnvil.patch52
1 files changed, 24 insertions, 28 deletions
diff --git a/nms-patches/ContainerAnvil.patch b/nms-patches/ContainerAnvil.patch
index f18c3171..f42c2945 100644
--- a/nms-patches/ContainerAnvil.patch
+++ b/nms-patches/ContainerAnvil.patch
@@ -1,24 +1,22 @@
--- a/net/minecraft/server/ContainerAnvil.java
+++ b/net/minecraft/server/ContainerAnvil.java
-@@ -7,6 +7,12 @@
+@@ -6,6 +6,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-+ // CraftBukkit start
++// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
-+import org.bukkit.craftbukkit.inventory.CraftItemStack;
-+import org.bukkit.event.inventory.PrepareAnvilEvent;
+// CraftBukkit end
+
public class ContainerAnvil extends Container {
private static final Logger f = LogManager.getLogger();
-@@ -23,8 +29,13 @@
+@@ -22,8 +26,13 @@
private int k;
private String l;
private final EntityHuman m;
+ // CraftBukkit start
-+ private CraftInventoryView bukkitEntity = null;
++ private CraftInventoryView bukkitEntity;
+ private PlayerInventory player;
+ // CraftBukkit end
@@ -27,34 +25,34 @@
this.j = blockposition;
this.i = world;
this.m = entityhuman;
-@@ -110,7 +121,7 @@
+@@ -110,7 +119,7 @@
byte b1 = 0;
- if (itemstack == null) {
-- this.g.setItem(0, (ItemStack) null);
-+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), null); // CraftBukkit
+ if (itemstack.isEmpty()) {
+- this.g.setItem(0, ItemStack.a);
++ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.a = 0;
} else {
ItemStack itemstack1 = itemstack.cloneItemStack();
-@@ -128,7 +139,7 @@
- if (itemstack1.e() && itemstack1.getItem().a(itemstack, itemstack2)) {
- k = Math.min(itemstack1.h(), itemstack1.j() / 4);
+@@ -128,7 +137,7 @@
+ if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
+ k = Math.min(itemstack1.i(), itemstack1.k() / 4);
if (k <= 0) {
-- this.g.setItem(0, (ItemStack) null);
-+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), null); // CraftBukkit
+- this.g.setItem(0, ItemStack.a);
++ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.a = 0;
return;
}
-@@ -143,7 +154,7 @@
+@@ -143,7 +152,7 @@
this.k = l;
} else {
- if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
-- this.g.setItem(0, (ItemStack) null);
-+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), null); // CraftBukkit
+ if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.f())) {
+- this.g.setItem(0, ItemStack.a);
++ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit
this.a = 0;
return;
}
-@@ -270,7 +281,7 @@
+@@ -270,7 +279,7 @@
EnchantmentManager.a(map, itemstack1);
}
@@ -63,18 +61,19 @@
this.b();
}
}
-@@ -295,6 +306,7 @@
+@@ -295,6 +304,7 @@
}
public boolean a(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
- return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.e((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
+ return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
}
-@@ -352,6 +364,20 @@
+@@ -350,4 +360,18 @@
+
this.e();
}
-
++
+ // CraftBukkit start
+ @Override
+ public CraftInventoryView getBukkitView() {
@@ -88,7 +87,4 @@
+ return bukkitEntity;
+ }
+ // CraftBukkit end
-+
- static class SyntheticClass_1 {
-
- static final int[] a = new int[Enchantment.Rarity.values().length];
+ }