Skip to content

Commit 5f33f87

Browse files
committed
Java -> Simple
1 parent 7c95c31 commit 5f33f87

30 files changed

+158
-139
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,25 @@
6060
import org.maxgamer.quickshop.api.localization.text.TextManager;
6161
import org.maxgamer.quickshop.api.shop.*;
6262
import org.maxgamer.quickshop.chat.platform.minedown.BungeeQuickChat;
63-
import org.maxgamer.quickshop.command.JavaCommandManager;
63+
import org.maxgamer.quickshop.command.SimpleCommandManager;
6464
import org.maxgamer.quickshop.database.*;
6565
import org.maxgamer.quickshop.economy.Economy_GemsEconomy;
6666
import org.maxgamer.quickshop.economy.Economy_TNE;
6767
import org.maxgamer.quickshop.economy.Economy_Vault;
68-
import org.maxgamer.quickshop.integration.JavaIntegrationManager;
68+
import org.maxgamer.quickshop.integration.SimpleIntegrationManager;
6969
import org.maxgamer.quickshop.integration.worldguard.WorldGuardIntegration;
7070
import org.maxgamer.quickshop.listener.*;
7171
import org.maxgamer.quickshop.listener.worldedit.WorldEditAdapter;
72-
import org.maxgamer.quickshop.localization.text.JavaTextManager;
72+
import org.maxgamer.quickshop.localization.text.SimpleTextManager;
7373
import org.maxgamer.quickshop.nonquickshopstuff.com.rylinaux.plugman.util.PluginUtil;
7474
import org.maxgamer.quickshop.permission.PermissionManager;
75-
import org.maxgamer.quickshop.shop.JavaShopManager;
7675
import org.maxgamer.quickshop.shop.ShopLoader;
7776
import org.maxgamer.quickshop.shop.ShopPurger;
77+
import org.maxgamer.quickshop.shop.SimpleShopManager;
7878
import org.maxgamer.quickshop.shop.VirtualDisplayItem;
7979
import org.maxgamer.quickshop.util.Timer;
8080
import org.maxgamer.quickshop.util.*;
81-
import org.maxgamer.quickshop.util.compatibility.JavaCompatibilityManager;
81+
import org.maxgamer.quickshop.util.compatibility.SimpleCompatibilityManager;
8282
import org.maxgamer.quickshop.util.config.ConfigProviderLightning;
8383
import org.maxgamer.quickshop.util.config.ConfigurationFixerLightning;
8484
import org.maxgamer.quickshop.util.envcheck.*;
@@ -117,7 +117,7 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
117117
@Getter
118118
private static volatile boolean testing = false;
119119
/* Public QuickShop API */
120-
private final JavaCompatibilityManager compatibilityTool = new JavaCompatibilityManager(this);
120+
private final SimpleCompatibilityManager compatibilityTool = new SimpleCompatibilityManager(this);
121121
private final Map<String, Integer> limits = new HashMap<>(15);
122122
private final GameVersion gameVersion = GameVersion.get(ReflectFactory.getNMSVersion());
123123
/**
@@ -133,12 +133,12 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
133133
@Getter
134134
private final TpsWatcher tpsWatcher = new TpsWatcher();
135135
boolean onLoadCalled = false;
136-
private JavaIntegrationManager integrationHelper;
137-
private JavaDatabaseHelper databaseHelper;
138-
private JavaCommandManager commandManager;
136+
private SimpleIntegrationManager integrationHelper;
137+
private SimpleDatabaseHelper databaseHelper;
138+
private SimpleCommandManager commandManager;
139139
private ItemMatcher itemMatcher;
140-
private JavaShopManager shopManager;
141-
private JavaTextManager textManager;
140+
private SimpleShopManager shopManager;
141+
private SimpleTextManager textManager;
142142
private boolean priceChangeRequiresFee = false;
143143
/**
144144
* The BootError, if it not NULL, plugin will stop loading and show setted errors when use /qs
@@ -584,14 +584,14 @@ public final void onLoad() {
584584
this.onLoadCalled = true;
585585
getLogger().info("QuickShop " + getFork() + " - Early boot step - Booting up...");
586586
//BEWARE THESE ONLY RUN ONCE
587-
this.textManager = new JavaTextManager(this);
587+
this.textManager = new SimpleTextManager(this);
588588
this.buildInfo = new BuildInfo(getResource("BUILDINFO"));
589589
runtimeCheck(EnvCheckEntry.Stage.ON_LOAD);
590590
getLogger().info("Reading the configuration...");
591591
this.initConfiguration();
592592
this.bootError = null;
593593
getLogger().info("Loading up integration modules.");
594-
this.integrationHelper = new JavaIntegrationManager(this);
594+
this.integrationHelper = new SimpleIntegrationManager(this);
595595
this.integrationHelper.callIntegrationsLoad(IntegrateStage.onLoadBegin);
596596
if (getConfiguration().getBoolean("integration.worldguard.enable")) {
597597
Plugin wg = Bukkit.getPluginManager().getPlugin("WorldGuard");
@@ -853,15 +853,15 @@ public final void onEnable() {
853853

854854
getLogger().info("Registering commands...");
855855
/* PreInit for BootError feature */
856-
commandManager = new JavaCommandManager(this);
856+
commandManager = new SimpleCommandManager(this);
857857
//noinspection ConstantConditions
858858
getCommand("qs").setExecutor(commandManager);
859859
//noinspection ConstantConditions
860860
getCommand("qs").setTabCompleter(commandManager);
861861

862862
this.registerCustomCommands();
863863

864-
this.shopManager = new JavaShopManager(this);
864+
this.shopManager = new SimpleShopManager(this);
865865

866866
this.permissionChecker = new PermissionChecker(this);
867867
// Limit
@@ -1020,7 +1020,7 @@ private boolean setupDatabase() {
10201020
}
10211021
this.databaseManager = new DatabaseManager(this, ServiceInjector.getDatabaseCore(dbCore));
10221022
// Make the database up to date
1023-
this.databaseHelper = new JavaDatabaseHelper(this, this.databaseManager);
1023+
this.databaseHelper = new SimpleDatabaseHelper(this, this.databaseManager);
10241024
} catch (DatabaseManager.ConnectionException e) {
10251025
getLogger().log(Level.SEVERE, "Error when connecting to the database", e);
10261026
if (setupDBonEnableding) {

src/main/java/org/maxgamer/quickshop/command/JavaCommandManager.java renamed to src/main/java/org/maxgamer/quickshop/command/SimpleCommandManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* This file is a part of project QuickShop, the name is JavaCommandManager.java
2+
* This file is a part of project QuickShop, the name is SimpleCommandManager.java
33
* Copyright (C) PotatoCraft Studio and contributors
44
*
55
* This program is free software: you can redistribute it and/or modify it
@@ -43,13 +43,13 @@
4343

4444
@Data
4545
@SuppressWarnings("unchecked")
46-
public class JavaCommandManager implements CommandManager, TabCompleter, CommandExecutor {
46+
public class SimpleCommandManager implements CommandManager, TabCompleter, CommandExecutor {
4747
private static final String[] EMPTY_ARGS = new String[0];
4848
private final Set<CommandContainer> cmds = Sets.newCopyOnWriteArraySet(); //Because we open to allow register, so this should be thread-safe
4949
private final QuickShop plugin;
5050
private final CommandContainer rootContainer;
5151

52-
public JavaCommandManager(QuickShop plugin) {
52+
public SimpleCommandManager(QuickShop plugin) {
5353
this.plugin = plugin;
5454
this.rootContainer = CommandContainer.builder()
5555
.prefix("")

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Convert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void onCommand(@NotNull ConsoleCommandSender sender, @NotNull String comm
8686
AbstractDatabaseCore dbCore = new MySQLCore(plugin, Objects.requireNonNull(host, "MySQL host can't be null"), Objects.requireNonNull(user, "MySQL username can't be null"), Objects.requireNonNull(pass, "MySQL password can't be null"), Objects.requireNonNull(databaseStr, "MySQL database name can't be null"), Objects.requireNonNull(port, "MySQL port can't be null"), useSSL);
8787
DatabaseManager databaseManager = new DatabaseManager(QuickShop.getInstance(), dbCore);
8888
sender.sendMessage(ChatColor.GREEN + "Converting...");
89-
transferShops(new JavaDatabaseHelper(plugin, databaseManager), sender);
89+
transferShops(new SimpleDatabaseHelper(plugin, databaseManager), sender);
9090
databaseManager.unInit();
9191
sender.sendMessage(ChatColor.GREEN + "All done, please change your config.yml settings to mysql to apply the changes.");
9292
} catch (Exception e) {
@@ -107,7 +107,7 @@ public void onCommand(@NotNull ConsoleCommandSender sender, @NotNull String comm
107107
AbstractDatabaseCore core = new SQLiteCore(plugin, new File(plugin.getDataFolder(), "shops.db"));
108108
DatabaseManager databaseManager = new DatabaseManager(QuickShop.getInstance(), core);
109109
sender.sendMessage(ChatColor.GREEN + "Converting...");
110-
transferShops(new JavaDatabaseHelper(plugin, databaseManager), sender);
110+
transferShops(new SimpleDatabaseHelper(plugin, databaseManager), sender);
111111
databaseManager.unInit();
112112
sender.sendMessage(ChatColor.GREEN + "All done, please change your config.yml settings to sqlite to apply the changes.");
113113
} catch (Exception e) {
@@ -123,7 +123,7 @@ public void onCommand(@NotNull ConsoleCommandSender sender, @NotNull String comm
123123
}
124124
}
125125

126-
private void transferShops(@NotNull JavaDatabaseHelper helper, @NotNull CommandSender sender) {
126+
private void transferShops(@NotNull SimpleDatabaseHelper helper, @NotNull CommandSender sender) {
127127
plugin.getShopManager().getAllShops().forEach(shop -> {
128128
helper.removeShop(shop);
129129
helper.createShop(shop, null, (ignored) -> sender.sendMessage("Failed to convert shop " + shop));

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Create.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.maxgamer.quickshop.QuickShop;
3232
import org.maxgamer.quickshop.api.command.CommandHandler;
3333
import org.maxgamer.quickshop.api.shop.ShopAction;
34-
import org.maxgamer.quickshop.shop.JavaInfo;
34+
import org.maxgamer.quickshop.shop.SimpleInfo;
3535
import org.maxgamer.quickshop.util.MsgUtil;
3636
import org.maxgamer.quickshop.util.Util;
3737
import org.maxgamer.quickshop.util.holder.Result;
@@ -148,7 +148,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
148148

149149
// Send creation menu.
150150
plugin.getShopManager().getActions().put(sender.getUniqueId(),
151-
new JavaInfo(b.getLocation(), ShopAction.CREATE, item, b.getRelative(sender.getFacing().getOppositeFace())));
151+
new SimpleInfo(b.getLocation(), ShopAction.CREATE, item, b.getRelative(sender.getFacing().getOppositeFace())));
152152
plugin.getShopManager().handleChat(sender, price);
153153
return;
154154
}

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Item.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.maxgamer.quickshop.api.shop.PriceLimiterCheckResult;
3232
import org.maxgamer.quickshop.api.shop.PriceLimiterStatus;
3333
import org.maxgamer.quickshop.api.shop.Shop;
34-
import org.maxgamer.quickshop.shop.JavaPriceLimiter;
34+
import org.maxgamer.quickshop.shop.SimplePriceLimiter;
3535
import org.maxgamer.quickshop.util.MsgUtil;
3636
import org.maxgamer.quickshop.util.Util;
3737

@@ -64,7 +64,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
6464
if (!plugin.isAllowStack() && !QuickShop.getPermissionManager().hasPermission(sender, "quickshop.create.stacks")) {
6565
itemStack.setAmount(1);
6666
}
67-
JavaPriceLimiter limiter = new JavaPriceLimiter(
67+
SimplePriceLimiter limiter = new SimplePriceLimiter(
6868
plugin.getConfiguration().getDouble("shop.minimum-price"),
6969
plugin.getConfiguration().getInt("shop.maximum-price"),
7070
plugin.getConfiguration().getBoolean("shop.allow-free-shop"),

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Price.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.maxgamer.quickshop.api.shop.PriceLimiterStatus;
3232
import org.maxgamer.quickshop.api.shop.Shop;
3333
import org.maxgamer.quickshop.shop.ContainerShop;
34-
import org.maxgamer.quickshop.shop.JavaPriceLimiter;
34+
import org.maxgamer.quickshop.shop.SimplePriceLimiter;
3535
import org.maxgamer.quickshop.util.MsgUtil;
3636
import org.maxgamer.quickshop.util.Util;
3737

@@ -83,7 +83,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
8383
return;
8484
}
8585

86-
JavaPriceLimiter limiter = new JavaPriceLimiter(
86+
SimplePriceLimiter limiter = new SimplePriceLimiter(
8787
plugin.getConfiguration().getDouble("shop.minimum-price"),
8888
plugin.getConfiguration().getInt("shop.maximum-price"),
8989
plugin.getConfiguration().getBoolean("shop.allow-free-shop"),

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_SilentUnlimited.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.maxgamer.quickshop.QuickShop;
2626
import org.maxgamer.quickshop.api.command.CommandHandler;
2727
import org.maxgamer.quickshop.api.shop.Shop;
28-
import org.maxgamer.quickshop.shop.JavaShopManager;
28+
import org.maxgamer.quickshop.shop.SimpleShopManager;
2929
import org.maxgamer.quickshop.util.MsgUtil;
3030
import org.maxgamer.quickshop.util.Util;
3131

@@ -57,7 +57,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
5757
plugin.text().of(sender, "command.toggle-unlimited.unlimited").send();
5858
if (plugin.getConfiguration().getBoolean("unlimited-shop-owner-change")) {
5959
plugin.getShopManager().migrateOwnerToUnlimitedShopOwner(shop);
60-
plugin.text().of(sender, "unlimited-shop-owner-changed", ((JavaShopManager) plugin.getShopManager()).getCacheUnlimitedShopAccount().getName()).send();
60+
plugin.text().of(sender, "unlimited-shop-owner-changed", ((SimpleShopManager) plugin.getShopManager()).getCacheUnlimitedShopAccount().getName()).send();
6161
}
6262
return;
6363
}

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Size.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.maxgamer.quickshop.api.shop.PriceLimiterCheckResult;
3232
import org.maxgamer.quickshop.api.shop.PriceLimiterStatus;
3333
import org.maxgamer.quickshop.api.shop.Shop;
34-
import org.maxgamer.quickshop.shop.JavaPriceLimiter;
34+
import org.maxgamer.quickshop.shop.SimplePriceLimiter;
3535
import org.maxgamer.quickshop.util.MsgUtil;
3636
import org.maxgamer.quickshop.util.Util;
3737

@@ -68,7 +68,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
6868
}
6969
ItemStack pendingItemStack = shop.getItem().clone();
7070
pendingItemStack.setAmount(amount);
71-
JavaPriceLimiter limiter = new JavaPriceLimiter(
71+
SimplePriceLimiter limiter = new SimplePriceLimiter(
7272
plugin.getConfiguration().getDouble("shop.minimum-price"),
7373
plugin.getConfiguration().getInt("shop.maximum-price"),
7474
plugin.getConfiguration().getBoolean("shop.allow-free-shop"),

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_SuperCreate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.maxgamer.quickshop.QuickShop;
3030
import org.maxgamer.quickshop.api.command.CommandHandler;
3131
import org.maxgamer.quickshop.api.shop.ShopAction;
32-
import org.maxgamer.quickshop.shop.JavaInfo;
32+
import org.maxgamer.quickshop.shop.SimpleInfo;
3333
import org.maxgamer.quickshop.util.MsgUtil;
3434
import org.maxgamer.quickshop.util.Util;
3535

@@ -63,7 +63,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
6363
return;
6464
}
6565
// Send creation menu.
66-
final JavaInfo info = new JavaInfo(b.getLocation(), ShopAction.CREATE, sender.getInventory().getItemInMainHand(), b.getRelative(sender.getFacing().getOppositeFace()));
66+
final SimpleInfo info = new SimpleInfo(b.getLocation(), ShopAction.CREATE, sender.getInventory().getItemInMainHand(), b.getRelative(sender.getFacing().getOppositeFace()));
6767

6868
plugin.getShopManager().getActions().put(sender.getUniqueId(), info);
6969
plugin.text().of(sender, "how-much-to-trade-for", MsgUtil.convertItemStackToTranslateText(info.getItem().getType()), Integer.toString(plugin.isAllowStack() && QuickShop.getPermissionManager().hasPermission(sender, "quickshop.create.stacks") ? item.getAmount() : 1)).send();

src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Unlimited.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.maxgamer.quickshop.QuickShop;
2828
import org.maxgamer.quickshop.api.command.CommandHandler;
2929
import org.maxgamer.quickshop.api.shop.Shop;
30-
import org.maxgamer.quickshop.shop.JavaShopManager;
30+
import org.maxgamer.quickshop.shop.SimpleShopManager;
3131

3232
@AllArgsConstructor
3333
public class SubCommand_Unlimited implements CommandHandler<Player> {
@@ -50,7 +50,7 @@ public void onCommand(@NotNull Player sender, @NotNull String commandLabel, @Not
5050
plugin.text().of(sender, "command.toggle-unlimited.unlimited").send();
5151
if (plugin.getConfiguration().getBoolean("unlimited-shop-owner-change")) {
5252
plugin.getShopManager().migrateOwnerToUnlimitedShopOwner(shop);
53-
plugin.text().of(sender, "unlimited-shop-owner-changed", ((JavaShopManager) plugin.getShopManager()).getCacheUnlimitedShopAccount().getName()).send();
53+
plugin.text().of(sender, "unlimited-shop-owner-changed", ((SimpleShopManager) plugin.getShopManager()).getCacheUnlimitedShopAccount().getName()).send();
5454
}
5555
return;
5656
}

0 commit comments

Comments
 (0)