Skip to content

Commit aac614a

Browse files
committed
clean up
1 parent 2993971 commit aac614a

File tree

4 files changed

+0
-123
lines changed

4 files changed

+0
-123
lines changed

src/main/java/org/maxgamer/quickshop/QuickShop.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -744,26 +744,6 @@ private void initConfiguration() {
744744
getLogger().severe("Failed to save config.yml from jar, The binary file of QuickShop may corrupted. Please re-download from our website.");
745745
}
746746
reloadConfiguration();
747-
/*
748-
From https://bukkit.gamepedia.com/Configuration_API_Reference#CopyDefaults:
749-
The copyDefaults option changes the behavior of Configuration's save method.
750-
By default, the defaults of the configuration will not be written to the target save file.
751-
If set to true, it will write out the default values, to the target file.
752-
However, once written, you will not be able to tell the difference between a default and a value from the configuration.
753-
==========================================================================================================================
754-
getConfiguration().options().copyDefaults(true).header("Read the example-configuration.yml file to get commented example config file."); // Load defaults.
755-
saveDefaultConfig();
756-
reloadConfig();
757-
*/
758-
// getConfiguration().options().copyHeader(false).header(
759-
// "=================================\n" +
760-
// "= QuickShop Configuration =\n" +
761-
// "=================================\n" +
762-
// "\nNotes:\n" +
763-
// "Please read the example-configuration.yml file to get a commented example config.\n" +
764-
// "Please read the example-configuration.yml file to get a commented example config.\n" +
765-
// "Please read the example-configuration.yml file to get a commented example config.\n"
766-
// );
767747
if (getConfiguration().getOrDefault("config-version", 0) == 0) {
768748
getConfiguration().set("config-version", 1);
769749
}
@@ -844,11 +824,6 @@ public final void onEnable() {
844824
MsgUtil.loadItemi18n();
845825
MsgUtil.loadEnchi18n();
846826
MsgUtil.loadPotioni18n();
847-
// shopControlPanelManager = new ShopControlPanel(this);
848-
// this.previewProtectionLore = MsgUtil.getMessageOfflinePlayer("quickshop-gui-preview", null);
849-
// if (this.previewProtectionLore == null || this.previewProtectionLore.isEmpty()) {
850-
// this.previewProtectionLore = ChatColor.RED + "FIXME: DON'T SET THIS TO EMPTY STRING";
851-
// }
852827

853828
/* Load 3rd party supports */
854829
load3rdParty();

src/main/java/org/maxgamer/quickshop/shop/SimpleInfo.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ public void setAction(@NotNull ShopAction action) {
104104
return this.item;
105105
}
106106

107-
/*
108-
* public Material getMaterial(){ return this.item.getType(); } public byte
109-
* getData(){ return this.getData(); }
110-
*/
111107

112108
/**
113109
* @return Location loc, Get shop's location,

src/main/java/org/maxgamer/quickshop/shop/SimpleShopManager.java

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public class SimpleShopManager implements ShopManager, Reloadable {
9292
@Getter
9393
private Trader cacheUnlimitedShopAccount;
9494
private SimplePriceLimiter priceLimiter;
95-
//private boolean useFastShopSearchAlgorithm;
9695
private boolean useOldCanBuildAlgorithm;
9796
private boolean autoSign;
9897

@@ -420,66 +419,9 @@ public void createShop(@NotNull Shop shop, @NotNull Info info) {
420419
Util.debugLog("Location is null.");
421420
return null;
422421
}
423-
424-
//if (this.useFastShopSearchAlgorithm) {
425422
return getShopIncludeAttached_Fast(loc, false, useCache);
426-
// } else {
427-
// return getShopIncludeAttached_Classic(loc);
428-
// }
429423
}
430424

431-
// public @Nullable Shop getShopIncludeAttached_Classic(@NotNull Location loc) {
432-
// @Nullable Shop shop;
433-
// // Get location's chunk all shops
434-
// @Nullable Map<Location, Shop> inChunk = getShops(loc.getChunk());
435-
// // Found some shops in this chunk.
436-
// if (inChunk != null) {
437-
// shop = inChunk.get(loc);
438-
// if (shop != null) {
439-
// // Okay, shop was founded.
440-
// return shop;
441-
// }
442-
// // Ooops, not founded that shop in this chunk.
443-
// }
444-
// @Nullable Block secondHalfShop = Util.getSecondHalf(loc.getBlock());
445-
// if (secondHalfShop != null) {
446-
// inChunk = getShops(secondHalfShop.getChunk());
447-
// if (inChunk != null) {
448-
// shop = inChunk.get(secondHalfShop.getLocation());
449-
// if (shop != null) {
450-
// // Okay, shop was founded.
451-
// return shop;
452-
// }
453-
// // Oooops, no any shops matched.
454-
// }
455-
// }
456-
//
457-
// // only check if is sign
458-
// Block block = loc.getBlock();
459-
// BlockState state = PaperLib.getBlockState(loc.getBlock(), false).getState();
460-
// if (state instanceof Sign) {
461-
// // If that chunk nothing we founded, we should check it is attached.
462-
// @Nullable Block attachedBlock = Util.getAttached(block);
463-
// // Check is attached on some block.
464-
// if (attachedBlock == null) {
465-
// // Nope
466-
// return null;
467-
// } else {
468-
// // Okay we know it on some blocks.
469-
// // We need set new location and chunk.
470-
// inChunk = getShops(attachedBlock.getChunk());
471-
// // Found some shops in this chunk
472-
// if (inChunk != null) {
473-
// shop = inChunk.get(attachedBlock.getLocation());
474-
// // Okay, shop was founded.
475-
// return shop;
476-
// // Oooops, no any shops matched.
477-
// }
478-
// }
479-
// }
480-
// return null;
481-
// }
482-
483425
@Override
484426
public void bakeShopRuntimeRandomUniqueIdCache(@NotNull Shop shop) {
485427
shopRuntimeUUIDCaching.put(shop.getRuntimeRandomUniqueId(), shop);

src/main/java/org/maxgamer/quickshop/util/mojangapi/MojangAPI.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ public static class ResourcesAPI {
7878
protected final Cache<String, String> requestCachePool = CacheBuilder.newBuilder()
7979
.expireAfterWrite(7, TimeUnit.DAYS)
8080
.build();
81-
// private final LoadingCache<URL, Optional<String>> request = CacheBuilder.newBuilder()
82-
// .expireAfterAccess(10, TimeUnit.MINUTES)
83-
// .build(new HttpCacheLoader());
8481
private final MojangApiMirror apiMirror;
8582

8683
public ResourcesAPI(MojangApiMirror mirror) {
@@ -90,25 +87,11 @@ public ResourcesAPI(MojangApiMirror mirror) {
9087
public Optional<String> get(@NotNull String hash) {
9188
String url = apiMirror.getResourcesDownloadRoot() + "/" + hash.substring(0, 2) + "/" + hash;
9289
return Optional.ofNullable(HttpUtil.createGet(url));
93-
// return data;
94-
95-
96-
// try {
97-
// return request.get(new URL(apiMirror.getResourcesDownloadRoot() + "/" + hash.substring(0, 2) + "/" + hash));
98-
// } catch (ExecutionException | MalformedURLException e) {
99-
// return Optional.empty();
100-
// }
10190
}
10291
}
10392

10493

10594
public static class AssetsAPI {
106-
protected final Cache<String, String> requestCachePool = CacheBuilder.newBuilder()
107-
.expireAfterWrite(7, TimeUnit.DAYS)
108-
.build();
109-
// private final LoadingCache<URL, Optional<String>> request = CacheBuilder.newBuilder()
110-
// .expireAfterAccess(10, TimeUnit.MINUTES)
111-
// .build(new HttpCacheLoader());
11295
private final MetaAPI metaAPI;
11396

11497
AssetsAPI(@NotNull MojangApiMirror apiMirror, @NotNull String version) {
@@ -135,14 +118,6 @@ public Optional<AssetsFileData> getGameAssetsFile() {
135118
}
136119
String data = HttpUtil.createGet(assetIndexBean.getUrl());
137120
return Optional.of(new AssetsFileData(data, assetIndexBean.getSha1(), assetIndexBean.getId()));
138-
139-
// try {
140-
// Optional<String> fileContent = request.get(new URL(assetIndexBean.getUrl()));
141-
// return fileContent.map(s -> new AssetsFileData(s, assetIndexBean.getSha1(), assetIndexBean.getId()));
142-
// } catch (ExecutionException | MalformedURLException e) {
143-
// return Optional.empty();
144-
// }
145-
146121
}
147122

148123

@@ -208,13 +183,6 @@ public static class AssetIndexBean {
208183
}
209184

210185
public static class MetaAPI {
211-
//Cache with URL and Content(String)
212-
// private final LoadingCache<URL, Optional<String>> request = CacheBuilder.newBuilder()
213-
// .expireAfterAccess(10, TimeUnit.MINUTES)
214-
// .build(new HttpCacheLoader());
215-
protected final Cache<String, String> requestCachePool = CacheBuilder.newBuilder()
216-
.expireAfterWrite(7, TimeUnit.DAYS)
217-
.build();
218186
private final String metaEndpoint;
219187
private final String version;
220188

@@ -232,10 +200,6 @@ public MetaAPI(@NotNull MojangApiMirror mirror, @NotNull String version) {
232200
public Optional<String> get() {
233201

234202
String result = HttpUtil.createGet(this.metaEndpoint);
235-
// Optional<String> result = request.get(this.metaEndpoint);
236-
// if (!result.isPresent()) {
237-
// return Optional.empty();
238-
// }
239203
if (result == null) {
240204
Util.debugLog("Request Meta Endpoint failed.");
241205
return Optional.empty();

0 commit comments

Comments
 (0)