mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-05 23:37:44 +01:00
clean up guimanager reference
This commit is contained in:
parent
9fd038c34e
commit
a75c65dbeb
@ -107,11 +107,11 @@ public class UltimateStacker extends SongodaPlugin {
|
|||||||
// Setup plugin commands
|
// Setup plugin commands
|
||||||
this.commandManager = new CommandManager(this);
|
this.commandManager = new CommandManager(this);
|
||||||
this.commandManager.addCommand(new CommandUltimateStacker())
|
this.commandManager.addCommand(new CommandUltimateStacker())
|
||||||
.addSubCommand(new CommandSettings())
|
.addSubCommand(new CommandSettings(guiManager))
|
||||||
.addSubCommand(new CommandRemoveAll())
|
.addSubCommand(new CommandRemoveAll())
|
||||||
.addSubCommand(new CommandReload())
|
.addSubCommand(new CommandReload())
|
||||||
.addSubCommand(new CommandGiveSpawner())
|
.addSubCommand(new CommandGiveSpawner())
|
||||||
.addSubCommand(new CommandConvert());
|
.addSubCommand(new CommandConvert(guiManager));
|
||||||
|
|
||||||
this.entityUtils = new EntityUtils();
|
this.entityUtils = new EntityUtils();
|
||||||
|
|
||||||
@ -243,10 +243,6 @@ public class UltimateStacker extends SongodaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public GuiManager getGuiManager() {
|
|
||||||
return guiManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Config> getExtraConfig() {
|
public List<Config> getExtraConfig() {
|
||||||
return Arrays.asList(mobFile, itemFile, spawnerFile);
|
return Arrays.asList(mobFile, itemFile, spawnerFile);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.songoda.ultimatestacker.commands;
|
package com.songoda.ultimatestacker.commands;
|
||||||
|
|
||||||
import com.songoda.core.commands.AbstractCommand;
|
import com.songoda.core.commands.AbstractCommand;
|
||||||
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.ultimatestacker.UltimateStacker;
|
import com.songoda.ultimatestacker.UltimateStacker;
|
||||||
import com.songoda.ultimatestacker.gui.GUIConvert;
|
import com.songoda.ultimatestacker.gui.GUIConvert;
|
||||||
import com.songoda.ultimatestacker.utils.Methods;
|
import com.songoda.ultimatestacker.utils.Methods;
|
||||||
@ -13,9 +14,11 @@ import java.util.List;
|
|||||||
public class CommandConvert extends AbstractCommand {
|
public class CommandConvert extends AbstractCommand {
|
||||||
|
|
||||||
UltimateStacker instance;
|
UltimateStacker instance;
|
||||||
|
GuiManager guiManager;
|
||||||
|
|
||||||
public CommandConvert() {
|
public CommandConvert(GuiManager guiManager) {
|
||||||
super(true, "convert");
|
super(true, "convert");
|
||||||
|
this.guiManager = guiManager;
|
||||||
instance = UltimateStacker.getInstance();
|
instance = UltimateStacker.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +26,7 @@ public class CommandConvert extends AbstractCommand {
|
|||||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("WildStacker")
|
if (Bukkit.getPluginManager().isPluginEnabled("WildStacker")
|
||||||
|| Bukkit.getPluginManager().isPluginEnabled("StackMob")) {
|
|| Bukkit.getPluginManager().isPluginEnabled("StackMob")) {
|
||||||
instance.getGuiManager().showGUI((Player) sender, new GUIConvert());
|
guiManager.showGUI((Player) sender, new GUIConvert());
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(Methods.formatText("&cYou need to have the plugin &4WildStacker &cor &4StackMob &cenabled " +
|
sender.sendMessage(Methods.formatText("&cYou need to have the plugin &4WildStacker &cor &4StackMob &cenabled " +
|
||||||
"in order to convert data."));
|
"in order to convert data."));
|
||||||
|
@ -2,6 +2,7 @@ package com.songoda.ultimatestacker.commands;
|
|||||||
|
|
||||||
import com.songoda.core.commands.AbstractCommand;
|
import com.songoda.core.commands.AbstractCommand;
|
||||||
import com.songoda.core.configuration.editor.PluginConfigGui;
|
import com.songoda.core.configuration.editor.PluginConfigGui;
|
||||||
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.ultimatestacker.UltimateStacker;
|
import com.songoda.ultimatestacker.UltimateStacker;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -11,15 +12,17 @@ import java.util.List;
|
|||||||
public class CommandSettings extends AbstractCommand {
|
public class CommandSettings extends AbstractCommand {
|
||||||
|
|
||||||
UltimateStacker instance;
|
UltimateStacker instance;
|
||||||
|
GuiManager guiManager;
|
||||||
|
|
||||||
public CommandSettings() {
|
public CommandSettings(GuiManager guiManager) {
|
||||||
super(true, "Settings");
|
super(true, "Settings");
|
||||||
|
this.guiManager = guiManager;
|
||||||
instance = UltimateStacker.getInstance();
|
instance = UltimateStacker.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||||
instance.getGuiManager().showGUI((Player) sender, new PluginConfigGui(instance));
|
guiManager.showGUI((Player) sender, new PluginConfigGui(instance));
|
||||||
return ReturnType.SUCCESS;
|
return ReturnType.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user