mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
fix BrewingStand inventory is updated immediately instead of after firing the event. Now the event can be canceled correct. (#4351)
This commit is contained in:
parent
c4072ee90d
commit
0e09ac397d
@ -114,6 +114,7 @@ public final class AlchemyPotionBrewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<AlchemyPotion> inputList = new ArrayList<>();
|
List<AlchemyPotion> inputList = new ArrayList<>();
|
||||||
|
ItemStack[] outputList = new ItemStack[3];
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
ItemStack item = inventory.getItem(i);
|
ItemStack item = inventory.getItem(i);
|
||||||
@ -128,7 +129,7 @@ public final class AlchemyPotionBrewer {
|
|||||||
inputList.add(input);
|
inputList.add(input);
|
||||||
|
|
||||||
if (output != null) {
|
if (output != null) {
|
||||||
inventory.setItem(i, output.toItemStack(item.getAmount()).clone());
|
outputList[i] = output.toItemStack(item.getAmount()).clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +140,12 @@ public final class AlchemyPotionBrewer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
if(outputList[i] != null) {
|
||||||
|
inventory.setItem(i, outputList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
removeIngredient(inventory, player);
|
removeIngredient(inventory, player);
|
||||||
|
|
||||||
for (AlchemyPotion input : inputList) {
|
for (AlchemyPotion input : inputList) {
|
||||||
|
Loading…
Reference in New Issue
Block a user