Added ability to create island without GUI.

This commit is contained in:
Heknon 2020-03-23 14:03:19 -04:00 committed by Brianna
parent d1d0a3dc24
commit fec32fd8ea
2 changed files with 14 additions and 3 deletions

View File

@ -33,11 +33,20 @@ public class CreateCommand extends SubCommand {
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
FileConfiguration configLoad = config.getFileConfiguration(); FileConfiguration configLoad = config.getFileConfiguration();
if (islandManager.getIsland(player) == null) { if (islandManager.getIsland(player) == null) {
Config mainConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")); Config mainConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml"));
if (mainConfig.getFileConfiguration().getBoolean("Island.Creation.Menu.Enable")) { if (args.length == 1) {
Structure structure = skyblock.getStructureManager().getStructure(args[0]);
if (structure != null && islandManager.createIsland(player, structure)) {
messageManager.sendMessage(player, configLoad.getString("Island.Creator.Selector.Created.Message"));
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
} else if (structure == null) {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Create.StructureNotFound.Message"));
soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F);
}
} else if (mainConfig.getFileConfiguration().getBoolean("Island.Creation.Menu.Enable")) {
Creator.getInstance().open(player); Creator.getInstance().open(player);
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F); soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
} else { } else {

View File

@ -890,8 +890,10 @@ Command:
Create: Create:
Owner: Owner:
Message: '&bSkyBlock &8| &cError&8: &eYou are already an Island Owner.' Message: '&bSkyBlock &8| &cError&8: &eYou are already an Island Owner.'
StructureNotFound:
Message: '&bSkyBlock &8| &cError&8: &eNo Island structure with such a name.'
Info: Info:
Message: '&f&oOpens the Island Creator menu.' Message: '&f&oOpens the Island Creator menu. You can also enter a Structure name to instantly create an Island.'
Members: Members:
Info: Info:
Message: '&f&oOpen the Island Members menu.' Message: '&f&oOpen the Island Members menu.'