diff options
author | md_5 <git@md-5.net> | 2017-05-14 12:00:00 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-05-14 12:00:00 +1000 |
commit | 5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5 (patch) | |
tree | 0314ba59f51141bb5e0e7ff6ca7723d168ac94b9 /nms-patches/ContainerAnvil.patch | |
parent | 6e3cec8bc78269d72ef7ef49ce82a5eadfb9615a (diff) | |
download | craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.gz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.lz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.xz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.zip |
Update to Minecraft 1.12-pre2
Diffstat (limited to 'nms-patches/ContainerAnvil.patch')
-rw-r--r-- | nms-patches/ContainerAnvil.patch | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/nms-patches/ContainerAnvil.patch b/nms-patches/ContainerAnvil.patch index 0541e3c9..3953bb5b 100644 --- a/nms-patches/ContainerAnvil.patch +++ b/nms-patches/ContainerAnvil.patch @@ -11,12 +11,9 @@ public class ContainerAnvil extends Container { private static final Logger f = LogManager.getLogger(); -@@ -20,10 +24,15 @@ - private final BlockPosition j; - public int a; +@@ -22,8 +26,13 @@ private int k; -- private String l; -+ public String l; // PAIL: private -> public + public String renameText; private final EntityHuman m; + // CraftBukkit start + private CraftInventoryView bukkitEntity; @@ -28,43 +25,43 @@ this.j = blockposition; this.i = world; this.m = entityhuman; -@@ -117,7 +126,7 @@ +@@ -110,7 +119,7 @@ byte b1 = 0; if (itemstack.isEmpty()) { - this.g.setItem(0, ItemStack.a); + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit - this.a = 0; + this.levelCost = 0; } else { ItemStack itemstack1 = itemstack.cloneItemStack(); -@@ -140,7 +149,7 @@ +@@ -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.a); + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit - this.a = 0; + this.levelCost = 0; return; } -@@ -155,7 +164,7 @@ +@@ -143,7 +152,7 @@ this.k = l; } else { 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; + this.levelCost = 0; return; } -@@ -245,7 +254,7 @@ +@@ -236,7 +245,7 @@ } if (flag2 && !flag1) { - this.g.setItem(0, ItemStack.a); + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), ItemStack.a); // CraftBukkit - this.a = 0; + this.levelCost = 0; return; } -@@ -292,7 +301,7 @@ +@@ -283,7 +292,7 @@ EnchantmentManager.a(map, itemstack1); } @@ -73,7 +70,7 @@ this.b(); } } -@@ -317,6 +326,7 @@ +@@ -301,6 +310,7 @@ } public boolean a(EntityHuman entityhuman) { @@ -81,7 +78,7 @@ 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; } -@@ -372,4 +382,29 @@ +@@ -356,4 +366,29 @@ this.e(); } @@ -94,7 +91,7 @@ + for (int i = 0; i < this.listeners.size(); ++i) { + ICrafting icrafting = (ICrafting) this.listeners.get(i); + -+ icrafting.setContainerData(this, 0, this.a); ++ icrafting.setContainerData(this, 0, this.levelCost); + } + } + |