mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Update to Minecraft 1.12-pre2
This commit is contained in:
@@ -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);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
Reference in New Issue
Block a user