Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
Brianna 2019-09-07 17:43:08 -04:00
commit 1fd965c369
3 changed files with 12 additions and 10 deletions

View File

@ -107,11 +107,11 @@ public class UltimateStacker extends SongodaPlugin {
// Setup plugin commands
this.commandManager = new CommandManager(this);
this.commandManager.addCommand(new CommandUltimateStacker())
.addSubCommand(new CommandSettings())
.addSubCommand(new CommandSettings(guiManager))
.addSubCommand(new CommandRemoveAll())
.addSubCommand(new CommandReload())
.addSubCommand(new CommandGiveSpawner())
.addSubCommand(new CommandConvert());
.addSubCommand(new CommandConvert(guiManager));
this.entityUtils = new EntityUtils();
@ -243,10 +243,6 @@ public class UltimateStacker extends SongodaPlugin {
}
}
public GuiManager getGuiManager() {
return guiManager;
}
@Override
public List<Config> getExtraConfig() {
return Arrays.asList(mobFile, itemFile, spawnerFile);

View File

@ -1,6 +1,7 @@
package com.songoda.ultimatestacker.commands;
import com.songoda.core.commands.AbstractCommand;
import com.songoda.core.gui.GuiManager;
import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.gui.GUIConvert;
import com.songoda.ultimatestacker.utils.Methods;
@ -13,9 +14,11 @@ import java.util.List;
public class CommandConvert extends AbstractCommand {
UltimateStacker instance;
GuiManager guiManager;
public CommandConvert() {
public CommandConvert(GuiManager guiManager) {
super(true, "convert");
this.guiManager = guiManager;
instance = UltimateStacker.getInstance();
}
@ -23,7 +26,7 @@ public class CommandConvert extends AbstractCommand {
protected ReturnType runCommand(CommandSender sender, String... args) {
if (Bukkit.getPluginManager().isPluginEnabled("WildStacker")
|| Bukkit.getPluginManager().isPluginEnabled("StackMob")) {
instance.getGuiManager().showGUI((Player) sender, new GUIConvert());
guiManager.showGUI((Player) sender, new GUIConvert());
} else {
sender.sendMessage(Methods.formatText("&cYou need to have the plugin &4WildStacker &cor &4StackMob &cenabled " +
"in order to convert data."));

View File

@ -2,6 +2,7 @@ package com.songoda.ultimatestacker.commands;
import com.songoda.core.commands.AbstractCommand;
import com.songoda.core.configuration.editor.PluginConfigGui;
import com.songoda.core.gui.GuiManager;
import com.songoda.ultimatestacker.UltimateStacker;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -11,15 +12,17 @@ import java.util.List;
public class CommandSettings extends AbstractCommand {
UltimateStacker instance;
GuiManager guiManager;
public CommandSettings() {
public CommandSettings(GuiManager guiManager) {
super(true, "Settings");
this.guiManager = guiManager;
instance = UltimateStacker.getInstance();
}
@Override
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;
}