Skip to content

Commit fb3d69c

Browse files
committed
clean up
1 parent a590de2 commit fb3d69c

27 files changed

+346
-134
lines changed

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

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,46 +100,46 @@
100100

101101
public class QuickShop extends JavaPlugin implements QuickShopAPI {
102102

103-
/* Public QuickShop API */
104-
private final JavaCompatibilityManager compatibilityTool = new JavaCompatibilityManager(this);
105-
private JavaIntegrationManager integrationHelper;
106-
private JavaDatabaseHelper databaseHelper;
107-
private JavaCommandManager commandManager;
108-
private ItemMatcher itemMatcher;
109-
private JavaShopManager shopManager;
110-
private JavaTextManager textManager;
111-
private boolean priceChangeRequiresFee = false;
112-
private final Map<String, Integer> limits = new HashMap<>(15);
113-
private final GameVersion gameVersion = GameVersion.get(ReflectFactory.getNMSVersion());
114-
/* Public QuickShop API End */
115-
116103
/**
117104
* The active instance of QuickShop
118105
* You shouldn't use this if you really need it.
119106
*/
120107
@Deprecated
121108
public static QuickShop instance;
122-
123109
/**
124110
* The manager to check permissions.
125111
*/
126112
private static PermissionManager permissionManager;
127113
private static boolean loaded = false;
128-
129114
/**
130115
* If running environment test
131116
*/
132117
@Getter
133118
private static volatile boolean testing = false;
134-
119+
/* Public QuickShop API */
120+
private final JavaCompatibilityManager compatibilityTool = new JavaCompatibilityManager(this);
121+
private final Map<String, Integer> limits = new HashMap<>(15);
122+
private final GameVersion gameVersion = GameVersion.get(ReflectFactory.getNMSVersion());
135123
/**
136124
* The shop limites.
137125
*/
138126
private final ConfigProviderLightning configProvider = new ConfigProviderLightning(this, new File(getDataFolder(), "config.yml"));
139127
private final List<BukkitTask> timerTaskList = new ArrayList<>(3);
140128
@Getter
141129
private final ReloadManager reloadManager = new ReloadManager();
130+
/* Public QuickShop API End */
131+
@Getter
132+
private final QuickChat quickChat = new BungeeQuickChat(this);
133+
@Getter
134+
private final TpsWatcher tpsWatcher = new TpsWatcher();
142135
boolean onLoadCalled = false;
136+
private JavaIntegrationManager integrationHelper;
137+
private JavaDatabaseHelper databaseHelper;
138+
private JavaCommandManager commandManager;
139+
private ItemMatcher itemMatcher;
140+
private JavaShopManager shopManager;
141+
private JavaTextManager textManager;
142+
private boolean priceChangeRequiresFee = false;
143143
/**
144144
* The BootError, if it not NULL, plugin will stop loading and show setted errors when use /qs
145145
*/
@@ -196,7 +196,6 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
196196
*/
197197
@Getter
198198
private PermissionChecker permissionChecker;
199-
200199
/**
201200
* The error reporter to help devs report errors to Sentry.io
202201
*/
@@ -242,8 +241,6 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
242241
@Getter
243242
private BuildInfo buildInfo;
244243
@Getter
245-
private final QuickChat quickChat = new BungeeQuickChat(this);
246-
@Getter
247244
@Nullable
248245
private String currency = null;
249246
@Getter
@@ -255,8 +252,6 @@ public class QuickShop extends JavaPlugin implements QuickShopAPI {
255252
@Getter
256253
private ShopPurger shopPurger;
257254
@Getter
258-
private final TpsWatcher tpsWatcher = new TpsWatcher();
259-
@Getter
260255
@Nullable
261256
private NBTAPI nbtapi = null;
262257

src/main/java/org/maxgamer/quickshop/api/QuickShopAPI.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* This file is a part of project QuickShop, the name is QuickShopAPI.java
3+
* Copyright (C) PotatoCraft Studio and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License as published by the
7+
* Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
120
package org.maxgamer.quickshop.api;
221

322
import org.maxgamer.quickshop.api.command.CommandManager;
@@ -16,70 +35,84 @@
1635
public interface QuickShopAPI {
1736
/**
1837
* Getting Compatibility Manager (usually used for anti-chest)
38+
*
1939
* @return Compatibility Manager
2040
*/
2141
CompatibilityManager getCompatibilityManager();
2242

2343
/**
2444
* Getting Shop Manager which managing most of shops
45+
*
2546
* @return Shop manager
2647
*/
2748
ShopManager getShopManager();
2849

2950
/**
3051
* Getting QuickShop current stacking item support status
52+
*
3153
* @return Stacking Item support enabled
3254
*/
3355
boolean isAllowStack();
3456

3557
/**
3658
* Getting QuickShop current display item support status
59+
*
3760
* @return Display item enabled
3861
*/
3962
boolean isDisplayEnabled();
63+
4064
/**
4165
* Getting QuickShop current permission based shop amount limit status
66+
*
4267
* @return Limit enabled
4368
*/
4469
boolean isLimit();
70+
4571
/**
4672
* Getting QuickShop current permission based shop amount limits
73+
*
4774
* @return Permissions 2 Shop Amounts mapping
4875
*/
4976
Map<String, Integer> getLimits();
5077

5178
/**
5279
* Getting the helper to directly access the database
80+
*
5381
* @return The database helper
5482
*/
5583
DatabaseHelper getDatabaseHelper();
5684

5785
/**
5886
* Getting text manager that allow addon to create a user language locale based message
87+
*
5988
* @return The text maanger
6089
*/
6190
TextManager getTextManager();
6291

6392
/**
6493
* Getting current using ItemMatcher impl
94+
*
6595
* @return The item matcher
6696
*/
6797
ItemMatcher getItemMatcher();
6898

6999
/**
70100
* Getting the status that fee requires if user performing price change
101+
*
71102
* @return requires fee
72103
*/
73104
boolean isPriceChangeRequiresFee();
74105

75106
/**
76107
* Getting command manager that allow addon direct access QuickShop sub-command system
108+
*
77109
* @return The command manager
78110
*/
79111
CommandManager getCommandManager();
80112

81113
/**
82114
* Getting this server game version
115+
*
83116
* @return Game version
84117
*/
85118
GameVersion getGameVersion();

src/main/java/org/maxgamer/quickshop/api/command/CommandHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* The command handler that processing sub commands under QS main command
31+
*
3132
* @param <T> The subtype of CommandSender you want received
3233
*/
3334
public interface CommandHandler<T extends CommandSender> {

src/main/java/org/maxgamer/quickshop/api/compatibility/CompatibilityManager.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* This file is a part of project QuickShop, the name is CompatibilityManager.java
3+
* Copyright (C) PotatoCraft Studio and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License as published by the
7+
* Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
120
package org.maxgamer.quickshop.api.compatibility;
221

322
import org.bukkit.entity.Player;
@@ -9,6 +28,7 @@
928
public interface CompatibilityManager {
1029
/**
1130
* Check a module registered
31+
*
1232
* @param moduleName Module name
1333
* @return Is registered
1434
*/
@@ -30,16 +50,21 @@ public interface CompatibilityManager {
3050

3151
/**
3252
* Register compatibility module
53+
*
3354
* @param module Compatibility module
3455
*/
3556
void register(@NotNull CompatibilityModule module);
57+
3658
/**
3759
* Unregister a registered compatibility modules
60+
*
3861
* @param moduleName Compatibility module name
3962
*/
4063
void unregister(@NotNull String moduleName);
64+
4165
/**
4266
* Unregister a registered compatibility modules
67+
*
4368
* @param module Compatibility module
4469
*/
4570
void unregister(@NotNull CompatibilityModule module);

0 commit comments

Comments
 (0)