Fixes crash when NetherWorld is disabeled

Utils#sameWorld is not null-safe.
Add a check if nether world is enabled before running the other checks.
This commit is contained in:
BONNe 2023-06-13 14:13:17 +03:00 committed by GitHub
parent a51f5068e4
commit ed92e61cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ public class AdvancementListener implements Listener {
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onMove(PlayerMoveEvent e) {
if (!Util.sameWorld(e.getPlayer().getWorld(), addon.getNetherWorld())) {
if (!addon.getSettings().isNetherGenerate() || !Util.sameWorld(e.getPlayer().getWorld(), addon.getNetherWorld())) {
return;
}
// Nether fortress advancement