Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
ClockClap authored and = committed May 23, 2021
1 parent a685e2c commit c8c63d2
Showing 3 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -38,15 +38,10 @@ public void loadPlugins(String directory) {
List<Plugin> pluginList = new ArrayList<>();
for (Plugin plugin : plugins) {
try {
if(plugin instanceof TctJavaPlugin) {
String message = String.format("Loading %s", plugin.getDescription().getFullName());
plugin.getLogger().info(message);
plugin.onLoad();
pluginList.add(plugin);
} else {
String message = "Cannot loaded " + plugin.getDescription().getFullName() + " because plugin is not tct plugin.";
Logger.getLogger(clazz.getName()).log(Level.SEVERE, message);
}
String message = String.format("Loading %s", plugin.getDescription().getFullName());
plugin.getLogger().info(message);
plugin.onLoad();
pluginList.add(plugin);
} catch (Throwable ex) {
Logger.getLogger(clazz.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
}
@@ -61,8 +56,6 @@ public final void enablePlugins() {
SimplePluginManager pluginManager = (SimplePluginManager) Bukkit.getPluginManager();
for(Plugin pl : loadedPlugins) {
try {
TctJavaPlugin jPlugin = (TctJavaPlugin) pl;
jPlugin.setGame(NanamiTctApi.game);

List<Permission> perms = pl.getDescription().getPermissions();

4 changes: 2 additions & 2 deletions 7miTCT/src/main/java/me/clockclap/tct/NanamiTct.java
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ public void onEnable() {
utilities.addCommand("item", getName(), "", "アイテムを入手します。", Arrays.asList("i"), new CommandItem(this));
utilities.addCommand("shop", getName(), "", "アイテムを購入できます。", Arrays.asList("s"), new CommandShop(this));
utilities.addCommand("stat", getName(), "", "統計を確認できます。", new ArrayList<>(), new CommandStat(this));
utilities.addCommand("tctplugins", getName(), "", "ロードされているななみTCTのプラグイン一覧を表示します。", Arrays.asList("tctpl"), new CommandTctPlugin());
//utilities.addCommand("tctplugins", getName(), "", "ロードされているななみTCTのプラグイン一覧を表示します。", Arrays.asList("tctpl"), new CommandTctPlugin());

// Register items
CustomItems.register();
@@ -210,7 +210,7 @@ public void onEnable() {
customInventory = new CustomInventory(game);
customInventory.initialize();

loader.enablePlugins();
//loader.enablePlugins();
}

public TctGame getGame() {
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public void init() throws IOException {
f.mkdir();
}

NanamiTct.getTctPluginLoader().loadPlugins(datafolder + "/plugins");
//sNanamiTct.getTctPluginLoader().loadPlugins(datafolder + "/plugins");

//Set configurations
//config.yml

0 comments on commit c8c63d2

Please sign in to comment.