From eb8efe8539ac43ec4d44d4deceeab88e8513c1c1 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Mon, 30 Sep 2019 19:51:53 +0800 Subject: [PATCH] Both fixed #188 and #187 Former-commit-id: fec3abeed078e5fbbe2ee4b2afd340007409797d [formerly 1b60dd6daf35e9dea97603934d669ec9fe738881] Former-commit-id: 34d69eba1a463eb89c994aa9a36471751e7e7a47 --- .../maxgamer/quickshop/Shop/ShopManager.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index ade19ac88..1b3d6b164 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -661,20 +661,20 @@ public class ShopManager { //Get location's chunk all shops @Nullable HashMap inChunk = getShops(loc.getChunk()); //Found some shops in this chunk. - if(inChunk != null){ + if (inChunk != null) { shop = inChunk.get(loc); - if(shop != null){ + if (shop != null) { //Okay, shop was founded. return shop; } //Ooops, not founded that shop in this chunk. } - @Nullable Block secondHalfShop = Util.getSecondHalf(loc.getBlock()); - if(secondHalfShop != null){ + @Nullable Block secondHalfShop = Util.getSecondHalf(loc.getBlock()); + if (secondHalfShop != null) { inChunk = getShops(secondHalfShop.getChunk()); - if(inChunk != null){ + if (inChunk != null) { shop = inChunk.get(secondHalfShop.getLocation()); - if(shop!=null){ + if (shop != null) { //Okay, shop was founded. return shop; } @@ -684,18 +684,18 @@ public class ShopManager { //If that chunk nothing we founded, we should check it is attached. @Nullable Block attachedBlock = Util.getAttached(loc.getBlock()); //Check is attached on some block. - if(attachedBlock == null){ + if (attachedBlock == null) { //Nope Util.debugLog("No attached block."); return null; - }else{ + } else { //Okay we know it on some blocks. //We need set new location and chunk. inChunk = getShops(attachedBlock.getChunk()); //Found some shops in this chunk - if(inChunk != null){ + if (inChunk != null) { shop = inChunk.get(attachedBlock.getLocation()); - if(shop!=null){ + if (shop != null) { //Okay, shop was founded. return shop; }