diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java index 6f475b33e..b62494186 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java @@ -31,7 +31,7 @@ public class BlockListener implements Listener { @EventHandler(ignoreCancelled = true) public void onPlace(BlockPlaceEvent e) { BlockState bs = e.getBlock().getState(); - if (bs instanceof DoubleChest == false) + if (!(bs instanceof DoubleChest)) return; Block b = e.getBlock(); Player p = e.getPlayer(); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index 0f845fee6..4525ba61b 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -518,7 +518,7 @@ public class ContainerShop implements Shop { * Updates signs attached to the shop */ public void setSignText() { - if (Util.isLoaded(this.getLocation()) == false) + if (!Util.isLoaded(this.getLocation())) return; String[] lines = new String[4]; lines[0] = MsgUtil.getMessage("signs.header", this.ownerName()); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index a9a5af267..b595a2ac2 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -361,7 +361,7 @@ public class ShopManager { // Get the shop they interacted with Shop shop = plugin.getShopManager().getShop(info.getLocation()); // It's not valid anymore - if (shop == null || Util.canBeShop(info.getLocation().getBlock()) == false) { + if (shop == null || !Util.canBeShop(info.getLocation().getBlock())) { p.sendMessage(MsgUtil.getMessage("chest-was-removed")); return; } @@ -583,7 +583,7 @@ public class ShopManager { p.sendMessage(MsgUtil.getMessage("no-double-chests")); return; } - if (Util.canBeShop(info.getLocation().getBlock()) == false) { + if (!Util.canBeShop(info.getLocation().getBlock())) { p.sendMessage(MsgUtil.getMessage("chest-was-removed")); return; } diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 9587a2147..59be8caeb 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -853,12 +853,13 @@ public class Util { pEffects.add(MsgUtil.getPotioni18n(potionEffect.getType()) + " " + formatEnchLevel(potionEffect.getAmplifier())); } } - if (pEffects != null && pEffects.isEmpty() == false) { - String result = new String(); + if (!pEffects.isEmpty()) { + StringBuilder result = new StringBuilder(); for (String effectString : pEffects) { - result += effectString + "\n"; + result.append(effectString); + result.append("\n"); } - return result; + return result.toString(); } else { return null; }