Skip to content

Commit 8e8bec1

Browse files
committed
Revert "with description"
This reverts commit c76feaa. # Conflicts: # src/main/java/org/maxgamer/quickshop/economy/EconomyProviderNotFoundException.java # src/main/java/org/maxgamer/quickshop/economy/Economy_GemsEconomy.java # src/main/java/org/maxgamer/quickshop/economy/Economy_Reserve.java # src/main/java/org/maxgamer/quickshop/economy/Economy_TNE.java # src/main/java/org/maxgamer/quickshop/economy/Economy_Vault.java
1 parent e93e7c5 commit 8e8bec1

File tree

8 files changed

+16
-94
lines changed

8 files changed

+16
-94
lines changed

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,4 @@ public static BootError econError() {
6666
"compatible economy plugin installed to get Vault working.");
6767
}
6868

69-
/**
70-
* Call îf economy system failed to load. This checks the failure reason.
71-
*
72-
* @return The error reason.
73-
*/
74-
public static BootError econHandlerMissingError() {
75-
// Check if Vault is installed
76-
return new BootError(QuickShop.getInstance().getLogger(),
77-
"The selected economy handler not installed", "Please check the configuration.");
78-
}
79-
8069
}

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.maxgamer.quickshop.chat.platform.minedown.BungeeQuickChat;
6363
import org.maxgamer.quickshop.command.SimpleCommandManager;
6464
import org.maxgamer.quickshop.database.*;
65-
import org.maxgamer.quickshop.economy.EconomyProviderNotFoundException;
6665
import org.maxgamer.quickshop.economy.Economy_GemsEconomy;
6766
import org.maxgamer.quickshop.economy.Economy_TNE;
6867
import org.maxgamer.quickshop.economy.Economy_Vault;
@@ -498,21 +497,13 @@ public boolean loadEcon() {
498497
return false;
499498
}
500499
economy = ServiceInjector.getEconomy(economy);
501-
if (Objects.equals(this.bootError, BuiltInSolution.econHandlerMissingError()) || Objects.equals(this.bootError, BuiltInSolution.econError())) {
502-
this.bootError = null;
503-
}
504500
} catch (Exception e) {
505-
if (e instanceof EconomyProviderNotFoundException) {
506-
getLogger().log(Level.WARNING, "Something going wrong when loading up economy system", e);
507-
getLogger().severe("Failed to hook into the Economy Handler that configuration point to!");
508-
getLogger().severe("QuickShop CANNOT start!");
509-
setupBootError(BuiltInSolution.econHandlerMissingError(), false);
510-
} else {
511-
getLogger().log(Level.WARNING, "Something going wrong when loading up economy system", e);
512-
getLogger().severe("QuickShop could not hook into a economy/Not found Vault or Reserve!");
513-
getLogger().severe("QuickShop CANNOT start!");
514-
setupBootError(BuiltInSolution.econError(), false);
515-
}
501+
this.getSentryErrorReporter().ignoreThrow();
502+
getLogger().log(Level.WARNING, "Something going wrong when loading up economy system", e);
503+
getLogger().severe("QuickShop could not hook into a economy/Not found Vault or Reserve!");
504+
getLogger().severe("QuickShop CANNOT start!");
505+
setupBootError(BuiltInSolution.econError(), false);
506+
getLogger().severe("Plugin listeners was disabled, please fix the economy issue.");
516507
return false;
517508
}
518509
return true;

src/main/java/org/maxgamer/quickshop/economy/EconomyProviderNotFoundException.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/main/java/org/maxgamer/quickshop/economy/Economy_GemsEconomy.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import lombok.ToString;
2525
import me.xanium.gemseconomy.api.GemsEconomyAPI;
2626
import me.xanium.gemseconomy.currency.Currency;
27-
import org.bukkit.Bukkit;
2827
import org.bukkit.OfflinePlayer;
2928
import org.bukkit.World;
3029
import org.bukkit.plugin.Plugin;
@@ -48,7 +47,7 @@ public class Economy_GemsEconomy extends AbstractEconomy {
4847
@Setter
4948
private GemsEconomyAPI api;
5049

51-
public Economy_GemsEconomy(@NotNull QuickShop plugin) throws EconomyProviderNotFoundException {
50+
public Economy_GemsEconomy(@NotNull QuickShop plugin) {
5251
super();
5352
this.plugin = plugin;
5453
this.formatter = new BuiltInEconomyFormatter(plugin);
@@ -62,10 +61,7 @@ private void init() {
6261
this.allowLoan = plugin.getConfiguration().getBoolean("shop.allow-economy-loan");
6362
}
6463

65-
private void setupEconomy() throws EconomyProviderNotFoundException {
66-
if (Bukkit.getPluginManager().getPlugin("GemsEconomy") == null) {
67-
throw new EconomyProviderNotFoundException("Configuration set economy to GemsEconomy but GemsEconomy not installed");
68-
}
64+
private void setupEconomy() {
6965
this.api = new GemsEconomyAPI();
7066
}
7167

src/main/java/org/maxgamer/quickshop/economy/Economy_Reserve.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class Economy_Reserve extends AbstractEconomy {
6262
* @deprecated Reserve no-longer active after Minecraft 1.14.
6363
*/
6464
@Deprecated
65-
public Economy_Reserve(@NotNull QuickShop plugin) throws EconomyProviderNotFoundException {
65+
public Economy_Reserve(@NotNull QuickShop plugin) {
6666
this.plugin = plugin;
6767
this.formatter = new BuiltInEconomyFormatter(plugin);
6868
plugin.getReloadManager().register(this);
@@ -71,19 +71,14 @@ public Economy_Reserve(@NotNull QuickShop plugin) throws EconomyProviderNotFound
7171
}
7272

7373
@SuppressWarnings("ConstantConditions")
74-
private void setup() throws EconomyProviderNotFoundException {
74+
private void setup() {
7575
try {
76-
Plugin pl = plugin.getServer().getPluginManager().getPlugin("Reserve");
77-
if (pl == null) {
78-
throw new EconomyProviderNotFoundException("Configuration set economy to Reserve but Reserve not installed");
79-
}
8076
Reserve re = ((Reserve) plugin.getServer().getPluginManager().getPlugin("Reserve"));
8177
if (re.economyProvided()) {
8278
reserve = re.economy();
8379
}
8480
} catch (Exception throwable) {
8581
reserve = null;
86-
plugin.getLogger().log(Level.SEVERE, "Failed to load up Reserve", throwable);
8782
}
8883
}
8984

src/main/java/org/maxgamer/quickshop/economy/Economy_TNE.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Economy_TNE extends AbstractEconomy {
4949
@Setter
5050
private TNEAPI api;
5151

52-
public Economy_TNE(@NotNull QuickShop plugin) throws EconomyProviderNotFoundException {
52+
public Economy_TNE(@NotNull QuickShop plugin) {
5353
super();
5454
this.plugin = plugin;
5555
plugin.getReloadManager().register(this);
@@ -61,12 +61,7 @@ private void init() {
6161
this.allowLoan = plugin.getConfiguration().getBoolean("shop.allow-economy-loan");
6262
}
6363

64-
private void setupEconomy() throws EconomyProviderNotFoundException {
65-
if (Bukkit.getPluginManager().getPlugin("TNE") == null
66-
&& Bukkit.getPluginManager().getPlugin("TNE-Bukkit") == null
67-
&& Bukkit.getPluginManager().getPlugin("TheNewEconomy") == null) {
68-
throw new EconomyProviderNotFoundException("Configuration set economy to TheNewEconomy but TheNewEconomy not installed");
69-
}
64+
private void setupEconomy() {
7065
this.api = TNE.instance().api();
7166
}
7267

src/main/java/org/maxgamer/quickshop/economy/Economy_Vault.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class Economy_Vault extends AbstractEconomy implements Listener {
5858
private net.milkbowl.vault.economy.Economy vault;
5959

6060

61-
public Economy_Vault(@NotNull QuickShop plugin) throws EconomyProviderNotFoundException {
61+
public Economy_Vault(@NotNull QuickShop plugin) {
6262
super();
6363
this.plugin = plugin;
6464
this.formatter = new BuiltInEconomyFormatter(plugin);
@@ -71,16 +71,15 @@ private void init() {
7171
this.allowLoan = plugin.getConfiguration().getBoolean("shop.allow-economy-loan");
7272
}
7373

74-
private boolean setupEconomy() throws EconomyProviderNotFoundException {
74+
private boolean setupEconomy() {
7575
if (!Util.isClassAvailable("net.milkbowl.vault.economy.Economy")) {
76-
throw new EconomyProviderNotFoundException("Configuration set economy to Vault but Vault not installed");
76+
return false; // QUICKSHOP-YS I can't believe it broken almost a year and nobody found it, my sentry exploded.
7777
}
7878
RegisteredServiceProvider<net.milkbowl.vault.economy.Economy> economyProvider;
7979
try {
8080
economyProvider = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
8181
} catch (Exception e) {
82-
plugin.getLogger().log(Level.SEVERE, "Failed to getting vault registration", e);
83-
throw new EconomyProviderNotFoundException();
82+
return false;
8483
}
8584

8685
if (economyProvider != null) {

src/main/resources/plugin.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ softdepend:
6868
- IridiumSkyblock
6969
- FabledSkyblock
7070
- NBTAPI
71-
- TNE
72-
- TNE-Bukkit
73-
- TheNewEconomy
74-
- GemsEconomy
7571

7672
api-version: 1.15
7773

0 commit comments

Comments
 (0)