Skip to content

Commit

Permalink
Fixed #1
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
TheDutchMC committed Nov 17, 2020
1 parent cb828b2 commit dfbacb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pluginVersion = 2.1.5
pluginVersion = 2.1.6
pluginGroup = nl.thedutchmc.harotorch
pluginName = HaroTorch
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static List<Location> getTorchLocationsNearPlayer(Player player, int radi
for(Map.Entry<Location, Torch> 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);
Expand Down

0 comments on commit dfbacb9

Please sign in to comment.