@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
+++ b/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
@@ -18,12 +18,16 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -17,12 +17,16 @@
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
@@ -10,7 +10,7 @@
|
||||
+
|
||||
public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final boolean DEBUG_COST = false;
|
||||
public static final int MAX_NAME_LENGTH = 50;
|
||||
- private int repairItemCountCost;
|
||||
@@ -18,7 +18,7 @@
|
||||
public String itemName;
|
||||
public final ContainerProperty cost;
|
||||
private static final int COST_FAIL = 0;
|
||||
@@ -33,6 +37,10 @@
|
||||
@@ -32,6 +36,10 @@
|
||||
private static final int COST_REPAIR_SACRIFICE = 2;
|
||||
private static final int COST_INCOMPATIBLE_PENALTY = 1;
|
||||
private static final int COST_RENAME = 1;
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||
this(i, playerinventory, ContainerAccess.NULL);
|
||||
@@ -105,7 +113,7 @@
|
||||
@@ -104,7 +112,7 @@
|
||||
byte b1 = 0;
|
||||
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -38,7 +38,7 @@
|
||||
this.cost.set(0);
|
||||
} else {
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
@@ -123,7 +131,7 @@
|
||||
@@ -122,7 +130,7 @@
|
||||
if (itemstack1.isDamageableItem() && itemstack1.getItem().isValidRepairItem(itemstack, itemstack2)) {
|
||||
k = Math.min(itemstack1.getDamageValue(), itemstack1.getMaxDamage() / 4);
|
||||
if (k <= 0) {
|
||||
@@ -47,7 +47,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -138,7 +146,7 @@
|
||||
@@ -137,7 +145,7 @@
|
||||
this.repairItemCountCost = i1;
|
||||
} else {
|
||||
if (!flag && (!itemstack1.is(itemstack2.getItem()) || !itemstack1.isDamageableItem())) {
|
||||
@@ -56,7 +56,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -228,7 +236,7 @@
|
||||
@@ -227,7 +235,7 @@
|
||||
}
|
||||
|
||||
if (flag2 && !flag1) {
|
||||
@@ -65,7 +65,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -252,11 +260,11 @@
|
||||
@@ -251,11 +259,11 @@
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -275,7 +283,8 @@
|
||||
@@ -274,7 +282,8 @@
|
||||
EnchantmentManager.setEnchantments(map, itemstack1);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
this.broadcastChanges();
|
||||
}
|
||||
}
|
||||
@@ -302,4 +311,18 @@
|
||||
@@ -301,4 +310,18 @@
|
||||
public int getCost() {
|
||||
return this.cost.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user