From dfbacb9a0db76d833b155254a57fe94b234456e4 Mon Sep 17 00:00:00 2001 From: TheDutchMC Date: Tue, 17 Nov 2020 10:45:47 +0100 Subject: [PATCH] Fixed #1 - Changed way in which I detect if two worlds are the same. World#equals() seems to throw NPE's when used with custom world names --- gradle.properties | 2 +- src/main/java/nl/thedutchmc/harotorch/torch/TorchHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e3b2027..cd503f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -pluginVersion = 2.1.5 +pluginVersion = 2.1.6 pluginGroup = nl.thedutchmc.harotorch pluginName = HaroTorch \ No newline at end of file diff --git a/src/main/java/nl/thedutchmc/harotorch/torch/TorchHandler.java b/src/main/java/nl/thedutchmc/harotorch/torch/TorchHandler.java index f1b3eeb..0f366e9 100644 --- a/src/main/java/nl/thedutchmc/harotorch/torch/TorchHandler.java +++ b/src/main/java/nl/thedutchmc/harotorch/torch/TorchHandler.java @@ -116,7 +116,7 @@ public static List getTorchLocationsNearPlayer(Player player, int radi for(Map.Entry entry : torches.entrySet()) { Location l = entry.getKey(); - if(!l.getWorld().equals(player.getLocation().getWorld())) continue; + if(!l.getWorld().getName().equals(player.getLocation().getWorld().getName())) continue; if(l.distanceSquared(player.getLocation()) < Math.pow(radius, 2)) { result.add(l);