Skip to content

Commit 04ef031

Browse files
sandtechnologydependabot[bot]github-actions[bot]crowdin-bot
authored
* Bump to 5.1.0.6 * Fix error when checking display item * PotatoCraft-Studio#141 Fix NPE when reporting error was disabled * PotatoCraft-Studio#142 Fix mojang file downloading always waiting for 20 secs, because it did not run at all * Fix "Container invalid" log not respect logging type * New Crowdin translations by Github Action (PotatoCraft-Studio#139) Co-authored-by: Crowdin Bot <support+bot@crowdin.com> * Bump MockBukkit-v1.18 from 1.18.1 to 1.24.1 (PotatoCraft-Studio#140) Bumps [MockBukkit-v1.18](https://github.com/MockBukkit/MockBukkit) from 1.18.1 to 1.24.1. - [Release notes](https://github.com/MockBukkit/MockBukkit/releases) - [Commits](https://github.com/MockBukkit/MockBukkit/commits) --- updated-dependencies: - dependency-name: com.github.seeseemelk:MockBukkit-v1.18 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump SongodaCore from 2.6.11 to 2.6.12 (PotatoCraft-Studio#143) Bumps SongodaCore from 2.6.11 to 2.6.12. --- updated-dependencies: - dependency-name: com.songoda:SongodaCore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump SuperiorSkyblockAPI from 1.8.4 to 1.9.0 (PotatoCraft-Studio#137) Bumps SuperiorSkyblockAPI from 1.8.4 to 1.9.0. --- updated-dependencies: - dependency-name: com.bgsoftware:SuperiorSkyblockAPI dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openinvapi from 4.1.9 to 4.1.10 (PotatoCraft-Studio#138) Bumps [openinvapi](https://github.com/Jikoo/OpenInv) from 4.1.9 to 4.1.10. - [Release notes](https://github.com/Jikoo/OpenInv/releases) - [Commits](Jikoo/OpenInv@4.1.9...4.1.10) --- updated-dependencies: - dependency-name: com.github.jikoo.OpenInv:openinvapi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove intellectualsites repo since it already released in maven central * Add whitelist-worlds feature for WorldGuardIntegration * Fix bad config * Fix wrong item meta comparing when shop item have no meta and using QS matcher This cause user trade item which is special to normal item shop * Implement refund-from-tax-account-as-much-as-possible feature * Use local variable in refunding * [2nd] Fix wrong item meta comparing when shop item have no meta and using QS matcher This cause user trade item which is special to normal item shop * Fix a bug for taking tax account when refunding Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
1 parent 6547d97 commit 04ef031

File tree

13 files changed

+246
-85
lines changed

13 files changed

+246
-85
lines changed

crowdin/lang/fr-FR/messages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
"no-creative-break": "&cVous ne pouvez pas détruire les boutiques des autres joueurs en mode créatif, basculez en mode survie ou essayez d'utiliser le super-outil {0} à la place.",
1818
"trading-in-creative-mode-is-disabled": "&cVous ne pouvez pas utiliser une boutique en mode créatif.",
1919
"supertool-is-disabled": "&cLe super-outil est désactivé, impossible de détruire une boutique avec.",
20-
"disabled-in-this-world": "&cQuickShop is disabled in this world",
20+
"disabled-in-this-world": "&cQuickShop est désactivé dans ce monde",
2121
"no-double-chests": "&cVous ne pouvez pas créer de boutique avec un double coffre.",
2222
"not-managed-shop": "&cVous n'êtes pas le propriétaire ou le modérateur de cette boutique",
2323
"shop-already-owned": "&cCeci est déjà une boutique.",
2424
"chest-was-removed": "&cLe coffre a été supprimé.",
2525
"price-too-cheap": "&cLe prix doit être supérieur à &e${0}",
2626
"no-price-change": "&cLe prix ne changera pas!",
2727
"you-cant-afford-a-new-shop": "&cLa création d'une boutique coûte {0}.",
28-
"player-bought-from-your-store-tax": "&c{0} purchased {1} {2} &r&cfrom your shop, and you earned {3} ({4} in taxes).",
28+
"player-bought-from-your-store-tax": "&c{0} a acheté {1} {2} &r&cdans votre magasin, et vous avez gagné {3} ({4} en taxes).",
2929
"you-cant-afford-to-change-price": "&cCela coûte {0} de changer le prix de ta boutique.",
3030
"success-created-shop": "&cBoutique crée avec succès.",
3131
"success-removed-shop": "&aBoutique supprimée avec succès.",

crowdin/lang/pl-PL/messages.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
"no-creative-break": "&cNie możesz zniszczyć sklepów innych graczy w trybie kreatywnym, przełącz się na tryb przetrwania lub zamiast tego spróbuj użyć SuperTool {0}.",
1818
"trading-in-creative-mode-is-disabled": "&cNie możesz handlować z tym sklepem, będąc w trybie kreatywnym.",
1919
"supertool-is-disabled": "&cSupertool jest wyłączone. Nie można zniszczyć żadnych sklepów.",
20-
"disabled-in-this-world": "&cQuickShop is disabled in this world",
20+
"disabled-in-this-world": "&cQuickShop jest wyłączony w tym świecie",
2121
"no-double-chests": "&cNie możesz stworzyć sklepu z podwójną skrzynią.",
2222
"not-managed-shop": "&cNie jesteś właścicielem ani moderatorem tego sklepu",
2323
"shop-already-owned": "&cTo już jest sklep.",
2424
"chest-was-removed": "&cSklep został usunięty.",
2525
"price-too-cheap": "&cCena musi być większa niż &e${0}",
2626
"no-price-change": "&cCena nie została zmieniona!",
2727
"you-cant-afford-a-new-shop": "&cMusisz mieć {0} aby zrobić nowy sklep.",
28-
"player-bought-from-your-store-tax": "&c{0} purchased {1} {2} &r&cfrom your shop, and you earned {3} ({4} in taxes).",
28+
"player-bought-from-your-store-tax": "&c{0} zakupił {1} {2} &r&cz Twojego sklepu i zarobiłeś {3} ({4} w podatkach).",
2929
"you-cant-afford-to-change-price": "&cMusisz mieć {0} aby zmienić cenę w sklepie.",
3030
"success-created-shop": "&cSklep utworzony.",
3131
"success-removed-shop": "&aSklep usunięty.",
@@ -38,7 +38,7 @@
3838
"not-a-number": "Możesz wpisać tylko liczbę, ty wpisałeś {0}.",
3939
"exceeded-maximum": "&cWartość przekroczyła maksymalną wartość w Java.",
4040
"not-a-integer": "&cMusisz wprowadzić całkowitą liczbę, ty wpisałeś {0}.",
41-
"player-bought-from-your-store": "&c{0} purchased {1} {2} &r&cfrom your shop, and you earned {3}.",
41+
"player-bought-from-your-store": "&c{0} zakupił {1} {2} &r&cz Twojego sklepu i zarobiłeś {3}.",
4242
"shop-out-of-stock": "&5W twoim sklepie na {0}, {1}, {2}, zabrakło {3}!",
4343
"shop-has-no-space": "&cSklep ma miejsce tylko na {0} więcej {1}.",
4444
"you-dont-have-that-many-items": "&cPosiadasz tylko {0} {1}.",

pom.xml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<artifactId>QuickShop</artifactId>
2626

2727
<properties>
28-
<pluginver>5.1.0.5</pluginver>
28+
<pluginver>5.1.0.6</pluginver>
2929
<package>org.maxgamer.quickshop</package>
3030
<developer>Ghost-chu</developer>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -380,14 +380,6 @@
380380
<id>EnderZone</id>
381381
<url>https://ci.ender.zone/plugin/repository/everything/</url>
382382
</repository>
383-
<repository>
384-
<id>intellectualsites releases</id>
385-
<url>https://mvn.intellectualsites.com/content/repositories/releases/</url>
386-
</repository>
387-
<repository>
388-
<id>intellectualsites snapshots</id>
389-
<url>https://mvn.intellectualsites.com/content/repositories/snapshots/</url>
390-
</repository>
391383
<repository>
392384
<id>jitpack.io</id>
393385
<url>https://jitpack.io</url>
@@ -529,7 +521,7 @@
529521
<dependency>
530522
<groupId>com.github.jikoo.OpenInv</groupId>
531523
<artifactId>openinvapi</artifactId>
532-
<version>4.1.9</version>
524+
<version>4.1.10</version>
533525
</dependency>
534526
<dependency>
535527
<groupId>org.projectlombok</groupId>
@@ -600,7 +592,7 @@
600592
<dependency>
601593
<groupId>com.github.seeseemelk</groupId>
602594
<artifactId>MockBukkit-v1.18</artifactId>
603-
<version>1.18.1</version>
595+
<version>1.24.1</version>
604596
<scope>test</scope>
605597
<exclusions>
606598
<exclusion>
@@ -790,7 +782,7 @@
790782
<dependency>
791783
<groupId>com.songoda</groupId>
792784
<artifactId>SongodaCore</artifactId>
793-
<version>2.6.11</version>
785+
<version>2.6.12</version>
794786
<scope>provided</scope>
795787
</dependency>
796788
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
@@ -822,7 +814,7 @@
822814
<dependency>
823815
<groupId>com.bgsoftware</groupId>
824816
<artifactId>SuperiorSkyblockAPI</artifactId>
825-
<version>1.8.4</version>
817+
<version>1.9.0</version>
826818
<scope>provided</scope>
827819
</dependency>
828820
<dependency>

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
import org.maxgamer.quickshop.util.matcher.item.BukkitItemMatcherImpl;
8787
import org.maxgamer.quickshop.util.matcher.item.QuickShopItemMatcherImpl;
8888
import org.maxgamer.quickshop.util.reload.ReloadManager;
89+
import org.maxgamer.quickshop.util.reporter.error.EmptyErrorReporter;
90+
import org.maxgamer.quickshop.util.reporter.error.IErrorReporter;
8991
import org.maxgamer.quickshop.util.reporter.error.RollbarErrorReporter;
9092
import org.maxgamer.quickshop.watcher.*;
9193

@@ -201,7 +203,7 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
201203
* The error reporter to help devs report errors to Sentry.io
202204
*/
203205
@Getter
204-
private RollbarErrorReporter sentryErrorReporter;
206+
private IErrorReporter sentryErrorReporter = new EmptyErrorReporter();
205207
/**
206208
* The server UniqueID, use to the ErrorReporter
207209
*/
@@ -2099,6 +2101,14 @@ private void updateConfig(int selectedVersion) throws IOException {
20992101
getConfig().set("shop.cost-goto-tax-account", false);
21002102
getConfig().set("config-version", ++selectedVersion);
21012103
}
2104+
if (selectedVersion == 156) {
2105+
getConfig().set("integration.worldguard.whitelist-worlds", Collections.singletonList("*"));
2106+
getConfig().set("config-version", ++selectedVersion);
2107+
}
2108+
if (selectedVersion == 157) {
2109+
getConfig().set("shop.refund-from-tax-account-as-much-as-possible", false);
2110+
getConfig().set("config-version", ++selectedVersion);
2111+
}
21022112
if (getConfig().isSet("shop.shop")) {
21032113
getConfig().set("shop.shop", null);
21042114
}

src/main/java/org/maxgamer/quickshop/integration/worldguard/WorldGuardIntegration.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.sk89q.worldguard.protection.regions.RegionQuery;
3535
import org.bukkit.ChatColor;
3636
import org.bukkit.Location;
37+
import org.bukkit.World;
3738
import org.bukkit.entity.Player;
3839
import org.jetbrains.annotations.NotNull;
3940
import org.maxgamer.quickshop.QuickShop;
@@ -44,14 +45,17 @@
4445
import org.maxgamer.quickshop.util.reload.ReloadResult;
4546
import org.maxgamer.quickshop.util.reload.ReloadStatus;
4647

48+
import java.util.ArrayList;
4749
import java.util.List;
4850
import java.util.logging.Level;
51+
import java.util.stream.Collectors;
4952

5053
@SuppressWarnings("DuplicatedCode")
5154
@IntegrationStage(loadStage = IntegrateStage.onLoadAfter)
5255
public class WorldGuardIntegration extends AbstractQSIntegratedPlugin {
5356
private final StateFlag createFlag = createOrGet("quickshop-create", false);
5457
private final StateFlag tradeFlag = createOrGet("quickshop-trade", true);
58+
private final List<String> whiteListWorldList = new ArrayList<>();
5559
private List<WorldGuardFlags> createFlags;
5660
private List<WorldGuardFlags> tradeFlags;
5761
private boolean anyOwner;
@@ -64,6 +68,16 @@ public WorldGuardIntegration(QuickShop plugin) {
6468
plugin.getReloadManager().register(this);
6569
}
6670

71+
private boolean checkWhitelist(Location location) {
72+
World world = location.getWorld();
73+
if (world != null) {
74+
if (!whiteListWorldList.contains("*") && !whiteListWorldList.contains(world.getName().toLowerCase())) {
75+
return false;
76+
}
77+
}
78+
return whiteList;
79+
}
80+
6781
private StateFlag createOrGet(String key, boolean def) {
6882
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
6983
Flag<?> result = WorldGuard.getInstance().getFlagRegistry().get(key);
@@ -99,6 +113,8 @@ private void init() {
99113
tradeFlags =
100114
WorldGuardFlags.deserialize(
101115
plugin.getConfig().getStringList("integration.worldguard.trade"));
116+
whiteListWorldList.clear();
117+
whiteListWorldList.addAll(plugin.getConfig().getStringList("integration.worldguard.whitelist-worlds").stream().map(String::toLowerCase).collect(Collectors.toList()));
102118
}
103119

104120
@Override
@@ -141,13 +157,13 @@ public boolean canCreateShopHere(@NotNull Player player, @NotNull Location locat
141157
//Regions not included global one
142158
if (applicableRegionSet.getRegions().isEmpty()) {
143159
if (!respectGlobalRegion) {
144-
return !whiteList;
160+
return !checkWhitelist(location);
145161
} else {
146162
//So check it manually
147163
RegionManager worldManger = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(location.getWorld()));
148164
if (worldManger != null && !worldManger.hasRegion("__global__")) {
149165
//If not have, just check whitelist
150-
return !whiteList;
166+
return !checkWhitelist(location);
151167
}
152168
}
153169
}
@@ -214,13 +230,13 @@ public boolean canTradeShopHere(@NotNull Player player, @NotNull Location locati
214230
//Regions not included global one
215231
if (applicableRegionSet.getRegions().isEmpty()) {
216232
if (!respectGlobalRegion) {
217-
return !whiteList;
233+
return !checkWhitelist(location);
218234
} else {
219235
//So check it manually
220236
RegionManager worldManger = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(location.getWorld()));
221237
if (worldManger != null && !worldManger.hasRegion("__global__")) {
222238
//If not have, just check whitelist
223-
return !whiteList;
239+
return !checkWhitelist(location);
224240
}
225241
}
226242
}

src/main/java/org/maxgamer/quickshop/localization/game/game/MojangGameLanguageImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.nio.file.Files;
4848
import java.util.Optional;
4949
import java.util.concurrent.*;
50+
import java.util.concurrent.atomic.AtomicBoolean;
5051
import java.util.concurrent.atomic.AtomicReference;
5152
import java.util.logging.Level;
5253

@@ -60,6 +61,7 @@ public class MojangGameLanguageImpl extends BukkitGameLanguageImpl implements Ga
6061
private final String languageCode;
6162
private final AtomicReference<Optional<JsonObject>> lang = new AtomicReference<>(Optional.empty());
6263
private MojangApiMirror mirror;
64+
private static final AtomicBoolean isTaskRunning = new AtomicBoolean(false);
6365

6466
@SneakyThrows
6567
public MojangGameLanguageImpl(@NotNull QuickShop plugin, @NotNull String languageCode) {
@@ -93,8 +95,13 @@ public MojangGameLanguageImpl(@NotNull QuickShop plugin, @NotNull String languag
9395
}
9496

9597
public void load() {
98+
if (isTaskRunning.get()) {
99+
plugin.getLogger().info("There are already have a i18n task downloading in background, please reset itemi18n.yml, potioni18n.yml and enchi18n.yml after download completed.");
100+
return;
101+
}
96102
FutureTask<Optional<JsonObject>> futureTask = new FutureTask<>(new GameLanguageLoadTask(plugin, languageCode, mirror));
97103
try {
104+
new Thread(futureTask, "QuickShop I18n file update task").start();
98105
this.lang.set(futureTask.get(20, TimeUnit.SECONDS));
99106
} catch (InterruptedException exception) {
100107
plugin.getLogger().log(Level.WARNING, "Failed to wait game language thread loading", exception);
@@ -218,6 +225,7 @@ public GameLanguageLoadTask(@NotNull QuickShop plugin, @NotNull String languageC
218225

219226
@Override
220227
public Optional<JsonObject> call() throws Exception {
228+
isTaskRunning.set(true);
221229
try {
222230
File cacheFile = new File(Util.getCacheFolder(), "mojanglang.cache"); // Load cache file
223231
if (!cacheFile.exists()) {
@@ -339,6 +347,8 @@ public Optional<JsonObject> call() throws Exception {
339347
} catch (Exception e) {
340348
plugin.getSentryErrorReporter().ignoreThrow();
341349
plugin.getLogger().log(Level.WARNING, "Something going wrong when loading game translation assets", e);
350+
} finally {
351+
isTaskRunning.set(false);
342352
}
343353
return Optional.empty();
344354
}

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

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
import lombok.EqualsAndHashCode;
2626
import me.lucko.helper.serialize.BlockPosition;
2727
import net.md_5.bungee.api.chat.BaseComponent;
28-
import org.bukkit.DyeColor;
29-
import org.bukkit.Location;
30-
import org.bukkit.Material;
31-
import org.bukkit.OfflinePlayer;
28+
import org.bukkit.*;
3229
import org.bukkit.block.Block;
3330
import org.bukkit.block.BlockFace;
3431
import org.bukkit.block.BlockState;
@@ -48,9 +45,11 @@
4845
import org.jetbrains.annotations.Nullable;
4946
import org.maxgamer.quickshop.QuickShop;
5047
import org.maxgamer.quickshop.api.chat.ComponentPackage;
48+
import org.maxgamer.quickshop.api.economy.EconomyCore;
5149
import org.maxgamer.quickshop.api.event.*;
5250
import org.maxgamer.quickshop.api.shop.*;
5351
import org.maxgamer.quickshop.chat.platform.minedown.BungeeQuickChat;
52+
import org.maxgamer.quickshop.economy.Trader;
5453
import org.maxgamer.quickshop.util.MsgUtil;
5554
import org.maxgamer.quickshop.util.Util;
5655
import org.maxgamer.quickshop.util.logging.container.ShopRemoveLog;
@@ -490,8 +489,28 @@ public void delete(boolean memoryOnly) {
490489
// Delete it from the database
491490
// Refund if necessary
492491
if (plugin.getConfig().getBoolean("shop.refund")) {
493-
plugin.getEconomy().deposit(this.getOwner(), plugin.getConfig().getDouble("shop.cost"),
494-
Objects.requireNonNull(getLocation().getWorld()), getCurrency());
492+
final EconomyCore economyCore = plugin.getEconomy();
493+
final double cost = plugin.getConfig().getDouble("shop.cost");
494+
final World world = Objects.requireNonNull(getLocation().getWorld());
495+
final String currency = getCurrency();
496+
if (plugin.getConfig().getBoolean("shop.refund-from-tax-account-as-much-as-possible")) {
497+
double balanceShouldTake;
498+
if (taxAccount != null) {
499+
balanceShouldTake = Math.max(0, Math.min(cost, economyCore.getBalance(taxAccount, world, currency)));
500+
if (balanceShouldTake != 0) {
501+
economyCore.withdraw(taxAccount, balanceShouldTake, world, currency);
502+
}
503+
} else {
504+
Trader taxDefaultTrader = ((SimpleShopManager) plugin.getShopManager()).getCacheTaxAccount();
505+
if (taxDefaultTrader != null) {
506+
balanceShouldTake = Math.max(0, Math.min(cost, economyCore.getBalance(taxDefaultTrader, world, currency)));
507+
if (balanceShouldTake != 0) {
508+
economyCore.withdraw(taxDefaultTrader, balanceShouldTake, world, currency);
509+
}
510+
}
511+
}
512+
}
513+
economyCore.deposit(this.getOwner(), cost, world, currency);
495514
}
496515
plugin.getShopManager().removeShop(this);
497516
plugin.getDatabaseHelper().removeShop(this);
@@ -1496,7 +1515,7 @@ public void checkContainer() {
14961515
if (!Util.canBeShop(this.getLocation().getBlock())) {
14971516
Util.debugLog("Shop at " + this.getLocation() + "@" + this.getLocation().getBlock()
14981517
+ " container was missing, deleting...");
1499-
plugin.getDatabaseHelper().insertHistoryRecord(new ShopRemoveLog(Util.getNilUniqueId(), "Container invalid", saveToInfoStorage()));
1518+
plugin.logEvent(new ShopRemoveLog(Util.getNilUniqueId(), "Container invalid", saveToInfoStorage()));
15001519
this.onUnload();
15011520
this.delete(false);
15021521
}

src/main/java/org/maxgamer/quickshop/util/MsgUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.maxgamer.quickshop.util;
2121

2222
import com.google.common.collect.Maps;
23-
import com.google.gson.JsonParseException;
2423
import lombok.Getter;
2524
import org.apache.commons.lang3.StringUtils;
2625
import org.bukkit.Bukkit;
@@ -771,7 +770,7 @@ public static boolean isJson(String str) {
771770
try {
772771
JsonUtil.readObject(str);
773772
return true;
774-
} catch (JsonParseException exception) {
773+
} catch (Exception exception) {
775774
return false;
776775
}
777776
}

src/main/java/org/maxgamer/quickshop/util/matcher/item/QuickShopItemMatcherImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,12 @@ public boolean matches(@Nullable ItemStack requireStack, @Nullable ItemStack giv
176176
if (requireStack.isSimilar(givenStack)) {
177177
return true;
178178
}
179-
/* If they are the same type, they should also have item meta
179+
180+
//Check if both have item meta
180181
if (requireStack.hasItemMeta() != givenStack.hasItemMeta()) {
181182
return false;
182-
}*/
183+
}
184+
183185
if (requireStack.hasItemMeta()) {
184186
return itemMetaMatcher.matches(requireStack, givenStack);
185187
}
@@ -543,10 +545,10 @@ private void addIfEnable(ConfigurationSection itemMatcherConfig, String path, Ma
543545
}
544546

545547
boolean matches(ItemStack requireStack, ItemStack givenStack) {
546-
/* If they are the same type, they should also have item meta
548+
//Check if both have item meta
547549
if (requireStack.hasItemMeta() != givenStack.hasItemMeta()) {
548550
return false;
549-
}*/
551+
}
550552
if (!requireStack.hasItemMeta()) {
551553
return true; // Passed check. no meta need to check.
552554
}

0 commit comments

Comments
 (0)