1
を初期化:java.lang.IllegalArgumentException: Plugin already initialized!
Bukkitプラグインはすでに
プラグインは動作しますが、イベント「AdventureMode」ない、ここのコードは次のとおりです。
package net.battleheroes.spigot.spacepvp;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import net.battleheroes.spigot.spacepvp.cmd.Feed;
import net.battleheroes.spigot.spacepvp.cmd.Fly;
import net.battleheroes.spigot.spacepvp.cmd.Heal;
import net.battleheroes.spigot.spacepvp.cmd.Kits;
import net.battleheroes.spigot.spacepvp.cmd.Spacepvp;
import net.battleheroes.spigot.spacepvp.cmd.gamemode;
import net.battleheroes.spigot.spacepvp.util.AdventureMode;
import net.battleheroes.spigot.spacepvp.util.ChatFormatting;
import net.battleheroes.spigot.spacepvp.util.Messages;
public class MainClass extends JavaPlugin implements ChatFormatting, Messages{
public void onEnable() {
Bukkit.getServer().getLogger().info(tag + green + enabled + orange + brand);
registerCommands();
registerEvents();
}
public void onDisable() {
Bukkit.getServer().getLogger().info(tag + red + disabled + orange + brand);
}
public void registerCommands() {
getCommand("spacepvp").setExecutor(new Spacepvp());
getCommand("kit").setExecutor(new Kits());
getCommand("heal").setExecutor(new Heal());
getCommand("feed").setExecutor(new Feed());
getCommand("fly").setExecutor(new Fly());
getCommand("gamemode").setExecutor(new gamemode());
}
public void registerEvents() {
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(new AdventureMode(), this);
}
}
私は同じクラスの他のプラグインはなく、テストサーバーのディレクトリは空です。
エラー
[07:41:11 ERROR]: Error occurred while enabling SpacePVP v0.4 (Is it up to date?)
java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:122) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:67) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.battleheroes.spigot.spacepvp.cmd.Fly.<init>(Fly.java:10) ~[?:?]
at net.battleheroes.spigot.spacepvp.MainClass.registerCommands(MainClass.java:40) ~[?:?]
at net.battleheroes.spigot.spacepvp.MainClass.onEnable(MainClass.java:24) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:271) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugin(CraftServer.java:376) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugins(CraftServer.java:326) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.MinecraftServer.t(MinecraftServer.java:421) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.MinecraftServer.l(MinecraftServer.java:382) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.MinecraftServer.a(MinecraftServer.java:337) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
Caused by: java.lang.IllegalStateException: Initial initialization
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:125) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:67) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.battleheroes.spigot.spacepvp.MainClass.<init>(MainClass.java:18) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_121]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_121]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_121]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_121]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.loadPlugins(CraftServer.java:301) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:204) ~[spigot.jar:git-Spigot-3fb9445-2b6c9f4]
... 2 more
これは 'JavaPlugin'を拡張する唯一のクラスですか?他のプラグインなしでプラグインをテストします。 –
多分 'Fly'は他のクラスです... StackTraceは、Fly.javaの10行目のコンストラクタがJavaPluginのコンストラクタを呼び出していることを示します –