mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-05 02:41:24 +01:00
Fixed Pair methods
This commit is contained in:
parent
40bda7e2e5
commit
eca3761a42
@ -30,22 +30,22 @@ public class AnvilListeners implements Listener {
|
|||||||
|
|
||||||
Pair<ItemStack, Integer> newOut = AnvilMerge.doMerge(left, right, out, name, player);
|
Pair<ItemStack, Integer> newOut = AnvilMerge.doMerge(left, right, out, name, player);
|
||||||
|
|
||||||
if(newOut.getKey() == null) {
|
if(newOut.getFirst() == null) {
|
||||||
newOut.setKey(new ItemStack(Material.AIR, 0));
|
newOut.setFirst(new ItemStack(Material.AIR, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
int modCost;
|
int modCost;
|
||||||
if(newOut.getValue() == null) {
|
if(newOut.getSecond() == null) {
|
||||||
modCost = 0;
|
modCost = 0;
|
||||||
} else {
|
} else {
|
||||||
modCost = newOut.getValue();
|
modCost = newOut.getSecond();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bukkit.getScheduler().runTask(EcoEnchantsPlugin.getInstance(), () -> {
|
Bukkit.getScheduler().runTask(EcoEnchantsPlugin.getInstance(), () -> {
|
||||||
final int cost = modCost + event.getInventory().getRepairCost();
|
final int cost = modCost + event.getInventory().getRepairCost();
|
||||||
event.getInventory().setRepairCost(cost);
|
event.getInventory().setRepairCost(cost);
|
||||||
event.setResult(newOut.getKey());
|
event.setResult(newOut.getFirst());
|
||||||
event.getInventory().setItem(2, newOut.getKey());
|
event.getInventory().setItem(2, newOut.getFirst());
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user