13
0
geforkt von Mirrors/Paper

SPIGOT-6890: Add repair cost amount in AnvilInventory

By: Doc <nachito94@msn.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2022-01-26 09:30:35 +11:00
Ursprung 2007d3c69f
Commit f46c4e64ea
2 geänderte Dateien mit 18 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerAnvil.java
+++ b/net/minecraft/world/inventory/ContainerAnvil.java
@@ -18,6 +18,10 @@
@@ -18,12 +18,16 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -11,6 +11,13 @@
public class ContainerAnvil extends ContainerAnvilAbstract {
private static final Logger LOGGER = LogManager.getLogger();
private static final boolean DEBUG_COST = false;
public static final int MAX_NAME_LENGTH = 50;
- private int repairItemCountCost;
+ public int repairItemCountCost; // PAIL private -> public
public String itemName;
public final ContainerProperty cost;
private static final int COST_FAIL = 0;
@@ -33,6 +37,10 @@
private static final int COST_REPAIR_SACRIFICE = 2;
private static final int COST_INCOMPATIBLE_PENALTY = 1;

Datei anzeigen

@ -27,6 +27,16 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn
return container.itemName;
}
@Override
public int getRepairCostAmount() {
return container.repairItemCountCost;
}
@Override
public void setRepairCostAmount(int amount) {
container.repairItemCountCost = amount;
}
@Override
public int getRepairCost() {
return container.cost.get();