1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-06-22 08:51:26 +02:00

Fix NPE for Alchemy Fixes Fixes

This commit is contained in:
nossr50 2024-09-14 15:19:13 -07:00
parent 9b046bd490
commit bac16238ac

@ -152,11 +152,16 @@ public class AlchemyBrewTask extends CancellableRunnable {
private void finish() { private void finish() {
final McMMOPlayerBrewEvent event = new McMMOPlayerBrewEvent(mmoPlayer, brewingStand); if (mmoPlayer == null) {
mcMMO.p.getServer().getPluginManager().callEvent(event); // Still need to finish brewing if the player is null
AlchemyPotionBrewer.finishBrewing(brewingStand, null, false);
} else {
final McMMOPlayerBrewEvent event = new McMMOPlayerBrewEvent(mmoPlayer, brewingStand);
mcMMO.p.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
AlchemyPotionBrewer.finishBrewing(brewingStand, mmoPlayer, false); AlchemyPotionBrewer.finishBrewing(brewingStand, mmoPlayer, false);
}
} }
Alchemy.brewingStandMap.remove(brewingStand.getLocation()); Alchemy.brewingStandMap.remove(brewingStand.getLocation());