SPIGOT-3368: Allow anvil level cost to be overwritten by properties
Dieser Commit ist enthalten in:
Ursprung
1314229dc2
Commit
763827668e
@ -11,11 +11,12 @@
|
||||
public class ContainerAnvil extends Container {
|
||||
|
||||
private static final Logger f = LogManager.getLogger();
|
||||
@@ -22,8 +26,13 @@
|
||||
@@ -22,8 +26,14 @@
|
||||
private int k;
|
||||
public String renameText;
|
||||
private final EntityHuman m;
|
||||
+ // CraftBukkit start
|
||||
+ private int lastLevelCost;
|
||||
+ private CraftInventoryView bukkitEntity;
|
||||
+ private PlayerInventory player;
|
||||
+ // CraftBukkit end
|
||||
@ -25,7 +26,7 @@
|
||||
this.j = blockposition;
|
||||
this.i = world;
|
||||
this.m = entityhuman;
|
||||
@@ -110,7 +119,7 @@
|
||||
@@ -110,7 +120,7 @@
|
||||
byte b1 = 0;
|
||||
|
||||
if (itemstack.isEmpty()) {
|
||||
@ -34,7 +35,7 @@
|
||||
this.levelCost = 0;
|
||||
} else {
|
||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||
@@ -128,7 +137,7 @@
|
||||
@@ -128,7 +138,7 @@
|
||||
if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
|
||||
k = Math.min(itemstack1.i(), itemstack1.k() / 4);
|
||||
if (k <= 0) {
|
||||
@ -43,7 +44,7 @@
|
||||
this.levelCost = 0;
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +152,7 @@
|
||||
@@ -143,7 +153,7 @@
|
||||
this.k = l;
|
||||
} else {
|
||||
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.f())) {
|
||||
@ -52,7 +53,7 @@
|
||||
this.levelCost = 0;
|
||||
return;
|
||||
}
|
||||
@@ -236,7 +245,7 @@
|
||||
@@ -236,7 +246,7 @@
|
||||
}
|
||||
|
||||
if (flag2 && !flag1) {
|
||||
@ -61,7 +62,7 @@
|
||||
this.levelCost = 0;
|
||||
return;
|
||||
}
|
||||
@@ -283,7 +292,7 @@
|
||||
@@ -283,7 +293,7 @@
|
||||
EnchantmentManager.a(map, itemstack1);
|
||||
}
|
||||
|
||||
@ -70,7 +71,7 @@
|
||||
this.b();
|
||||
}
|
||||
}
|
||||
@@ -301,6 +310,7 @@
|
||||
@@ -301,6 +311,7 @@
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
@ -78,7 +79,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;
|
||||
}
|
||||
|
||||
@@ -356,4 +366,29 @@
|
||||
@@ -356,4 +367,33 @@
|
||||
|
||||
this.e();
|
||||
}
|
||||
@ -91,8 +92,12 @@
|
||||
+ for (int i = 0; i < this.listeners.size(); ++i) {
|
||||
+ ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
||||
+
|
||||
+ icrafting.setContainerData(this, 0, this.levelCost);
|
||||
+ if (this.lastLevelCost != this.levelCost) {
|
||||
+ icrafting.setContainerData(this, 0, this.levelCost);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ this.lastLevelCost = this.levelCost;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren