diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index 151c2f40a..783622e63 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -75,7 +75,7 @@ public class EntitySpawnListener implements Listener { public static void testCreate(final Entity entity) { @NonNull World world = entity.getWorld(); - if (areaName == world.getName()) { + if (areaName.equals(world.getName())) { } else { areaName = world.getName(); hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); diff --git a/Core/src/main/java/com/plotsquared/core/util/StringMan.java b/Core/src/main/java/com/plotsquared/core/util/StringMan.java index ee7a614b8..388e46135 100644 --- a/Core/src/main/java/com/plotsquared/core/util/StringMan.java +++ b/Core/src/main/java/com/plotsquared/core/util/StringMan.java @@ -286,15 +286,13 @@ public class StringMan { } public static boolean isEqualIgnoreCase(String a, String b) { - return (a == b) || ((a != null) && (b != null) && (a.length() == b.length()) && a + return (a.equals(b)) || ((a != null) && (b != null) && (a.length() == b.length()) && a .equalsIgnoreCase(b)); } public static String repeat(String s, int n) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < n; i++) { - sb.append(s); - } + sb.append(String.valueOf(s).repeat(Math.max(0, n))); return sb.toString(); }