@@ -82,7 +82,7 @@ public class ShopManager implements Reloadable {
8282 private Trader cacheUnlimitedShopAccount ;
8383 @ Getter
8484 private PriceLimiter priceLimiter ;
85- private boolean useFastShopSearchAlgorithm ;
85+ // private boolean useFastShopSearchAlgorithm;
8686 private boolean useOldCanBuildAlgorithm ;
8787 private boolean autoSign ;
8888
@@ -95,8 +95,8 @@ public ShopManager(@NotNull QuickShop plugin) {
9595 }
9696
9797 private void init () {
98- this .useFastShopSearchAlgorithm =
99- plugin .getConfig ().getBoolean ("shop.use-fast-shop-search-algorithm" , false );
98+ // this.useFastShopSearchAlgorithm =
99+ // plugin.getConfig().getBoolean("shop.use-fast-shop-search-algorithm", false);
100100 Util .debugLog ("Loading caching tax account..." );
101101 String taxAccount = plugin .getConfig ().getString ("tax-account" , "tax" );
102102 if (!taxAccount .isEmpty ()) {
@@ -386,64 +386,64 @@ public void createShop(@NotNull Shop shop, @NotNull Info info) {
386386 return null ;
387387 }
388388
389- if (this .useFastShopSearchAlgorithm ) {
389+ // if (this.useFastShopSearchAlgorithm) {
390390 return getShopIncludeAttached_Fast (loc , false , useCache );
391- } else {
392- return getShopIncludeAttached_Classic (loc );
393- }
391+ // } else {
392+ // return getShopIncludeAttached_Classic(loc);
393+ // }
394394 }
395395
396- public @ Nullable Shop getShopIncludeAttached_Classic (@ NotNull Location loc ) {
397- @ Nullable Shop shop ;
398- // Get location's chunk all shops
399- @ Nullable Map <Location , Shop > inChunk = getShops (loc .getChunk ());
400- // Found some shops in this chunk.
401- if (inChunk != null ) {
402- shop = inChunk .get (loc );
403- if (shop != null ) {
404- // Okay, shop was founded.
405- return shop ;
406- }
407- // Ooops, not founded that shop in this chunk.
408- }
409- @ Nullable Block secondHalfShop = Util .getSecondHalf (loc .getBlock ());
410- if (secondHalfShop != null ) {
411- inChunk = getShops (secondHalfShop .getChunk ());
412- if (inChunk != null ) {
413- shop = inChunk .get (secondHalfShop .getLocation ());
414- if (shop != null ) {
415- // Okay, shop was founded.
416- return shop ;
417- }
418- // Oooops, no any shops matched.
419- }
420- }
421-
422- // only check if is sign
423- Block block = loc .getBlock ();
424- BlockState state = PaperLib .getBlockState (loc .getBlock (), false ).getState ();
425- if (state instanceof Sign ) {
426- // If that chunk nothing we founded, we should check it is attached.
427- @ Nullable Block attachedBlock = Util .getAttached (block );
428- // Check is attached on some block.
429- if (attachedBlock == null ) {
430- // Nope
431- return null ;
432- } else {
433- // Okay we know it on some blocks.
434- // We need set new location and chunk.
435- inChunk = getShops (attachedBlock .getChunk ());
436- // Found some shops in this chunk
437- if (inChunk != null ) {
438- shop = inChunk .get (attachedBlock .getLocation ());
439- // Okay, shop was founded.
440- return shop ;
441- // Oooops, no any shops matched.
442- }
443- }
444- }
445- return null ;
446- }
396+ // public @Nullable Shop getShopIncludeAttached_Classic(@NotNull Location loc) {
397+ // @Nullable Shop shop;
398+ // // Get location's chunk all shops
399+ // @Nullable Map<Location, Shop> inChunk = getShops(loc.getChunk());
400+ // // Found some shops in this chunk.
401+ // if (inChunk != null) {
402+ // shop = inChunk.get(loc);
403+ // if (shop != null) {
404+ // // Okay, shop was founded.
405+ // return shop;
406+ // }
407+ // // Ooops, not founded that shop in this chunk.
408+ // }
409+ // @Nullable Block secondHalfShop = Util.getSecondHalf(loc.getBlock());
410+ // if (secondHalfShop != null) {
411+ // inChunk = getShops(secondHalfShop.getChunk());
412+ // if (inChunk != null) {
413+ // shop = inChunk.get(secondHalfShop.getLocation());
414+ // if (shop != null) {
415+ // // Okay, shop was founded.
416+ // return shop;
417+ // }
418+ // // Oooops, no any shops matched.
419+ // }
420+ // }
421+ //
422+ // // only check if is sign
423+ // Block block = loc.getBlock();
424+ // BlockState state = PaperLib.getBlockState(loc.getBlock(), false).getState();
425+ // if (state instanceof Sign) {
426+ // // If that chunk nothing we founded, we should check it is attached.
427+ // @Nullable Block attachedBlock = Util.getAttached(block);
428+ // // Check is attached on some block.
429+ // if (attachedBlock == null) {
430+ // // Nope
431+ // return null;
432+ // } else {
433+ // // Okay we know it on some blocks.
434+ // // We need set new location and chunk.
435+ // inChunk = getShops(attachedBlock.getChunk());
436+ // // Found some shops in this chunk
437+ // if (inChunk != null) {
438+ // shop = inChunk.get(attachedBlock.getLocation());
439+ // // Okay, shop was founded.
440+ // return shop;
441+ // // Oooops, no any shops matched.
442+ // }
443+ // }
444+ // }
445+ // return null;
446+ // }
447447
448448 public void bakeShopRuntimeRandomUniqueIdCache (@ NotNull Shop shop ) {
449449 shopRuntimeUUIDCaching .put (shop .getRuntimeRandomUniqueId (), shop );
0 commit comments