1.2.0
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Obj_Select {
|
||||
public static void onSelect() {
|
||||
Main.guiHashMap.clear();
|
||||
Main.allAliases.clear();
|
||||
File f = new File(Main.getPath() + "/GUIs/");
|
||||
File[] fileArray = f.listFiles();
|
||||
|
||||
for (File config_gui : fileArray) {
|
||||
Main.allAliases.add(config_gui.getName().replace(".yml", ""));
|
||||
String sub = config_gui.getName().substring(config_gui.getName().length() - 4);
|
||||
if (sub.equals(".yml")) {
|
||||
YamlConfiguration yamlConfiguration_gui = YamlConfiguration.loadConfiguration(config_gui);
|
||||
|
||||
Boolean GUI_Enable = yamlConfiguration_gui.getBoolean("GUI.Enable");
|
||||
Integer GUI_Lines = yamlConfiguration_gui.getInt("GUI.Lines");
|
||||
if (yamlConfiguration_gui.getInt("GUI.Lines") > 6) {
|
||||
yamlConfiguration_gui.set("GUI.Lines", 6);
|
||||
}
|
||||
if (yamlConfiguration_gui.getInt("GUI.Lines") < 1) {
|
||||
yamlConfiguration_gui.set("GUI.Lines", 1);
|
||||
}
|
||||
String GUI_Name = yamlConfiguration_gui.getString("GUI.Name");
|
||||
Boolean GUI_FillItem_Enable = yamlConfiguration_gui.getBoolean("GUI.FillItem.Enable");
|
||||
String GUI_FillItem_Item;
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
GUI_FillItem_Item = yamlConfiguration_gui.getString("GUI.FillItem.GlassPaneCollor");
|
||||
} else GUI_FillItem_Item = yamlConfiguration_gui.getString("GUI.FillItem.Item");
|
||||
|
||||
|
||||
Boolean Command_Alias_Enable = yamlConfiguration_gui.getBoolean("Command.Alias");
|
||||
Boolean Command_Permission = yamlConfiguration_gui.getBoolean("Command.Permission.Required");
|
||||
|
||||
ArrayList<Slot> slots = new ArrayList<>();
|
||||
for (String key : yamlConfiguration_gui.getConfigurationSection("Slots").getKeys(false)) {
|
||||
Slot slot = new Slot(yamlConfiguration_gui.getInt("Slots." + key + ".Slot") - 1,
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Enable"),
|
||||
// yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.Removable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.Empty"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".Item.Amount"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.Base64.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.PlayerHead.Base64.Base64Value"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.PlayerWhoHasOpenedTheGUI"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.PlayerHead.PlayerName"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.Material"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.Name"),
|
||||
yamlConfiguration_gui.getList("Slots." + key + ".Item.Lore"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".CustomSound.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".CustomSound.NoSound"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".CustomSound.Sound"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Cost.Enable"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".Cost.Price"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.BungeeCommand"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.CommandAsConsole"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".Command.Command"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".ServerChange.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".ServerChange.Server"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".OpenGUI.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".OpenGUI.GUI"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Message.Enable"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".Message.Message"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Permission.Required"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.File.Path"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Option.Path"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Option.Premat"),
|
||||
// yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.ChatInput"),
|
||||
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Value.LeftClick.String"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.LeftClick.Boolean"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".SetConfig.Value.LeftClick.Integer"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".SetConfig.Value.LeftClick.Double"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".SetConfig.Value.LeftClick.List"),
|
||||
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Value.RightClick.String"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.RightClick.Boolean"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".SetConfig.Value.RightClick.Integer"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".SetConfig.Value.RightClick.Double"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".SetConfig.RightClick.Value.List"),
|
||||
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.PluginReload.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.PluginReload.Command"));
|
||||
slots.add(slot);
|
||||
|
||||
}
|
||||
Object objekt = new Object(GUI_Enable, GUI_Lines, GUI_Name, GUI_FillItem_Enable, GUI_FillItem_Item,
|
||||
config_gui.getName().replace(".yml", ""), Command_Alias_Enable, Command_Permission, slots);
|
||||
|
||||
Main.guiHashMap.put(config_gui.getName().replace(".yml", ""), objekt);
|
||||
CmdExecuter_GUI.arg1.put(config_gui.getName().replace(".yml", ""), "commandgui.gui." + config_gui.getName().replace(".yml", ""));
|
||||
|
||||
try {
|
||||
yamlConfiguration_gui.save(config_gui);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Object {
|
||||
public Boolean GUI_Enable;
|
||||
public Integer GUI_Lines;
|
||||
public String GUI_Name;
|
||||
public Boolean GUI_FillItem_Enable;
|
||||
public String GUI_FillItem_Item;
|
||||
|
||||
|
||||
public String Command_Command;
|
||||
public Boolean Command_Alias_Enable;
|
||||
public Boolean Command_Permission_Enable;
|
||||
public ArrayList<Slot> GUI_Slots;
|
||||
|
||||
public Object(Boolean GUI_Enable, Integer GUI_Lines, String GUI_Name, Boolean GUI_FillItem_Enable, String GUI_FillItem_Item,
|
||||
String Command_Command, Boolean Command_Alias_Enable, Boolean Command_Permission_Enable, ArrayList<Slot> GUI_Slots){
|
||||
this.GUI_Enable = GUI_Enable;
|
||||
this.GUI_Lines = GUI_Lines;
|
||||
this.GUI_Name = GUI_Name;
|
||||
this.GUI_FillItem_Enable = GUI_FillItem_Enable;
|
||||
this.GUI_FillItem_Item = GUI_FillItem_Item;
|
||||
this.Command_Command = Command_Command;
|
||||
this.Command_Alias_Enable = Command_Alias_Enable;
|
||||
this.Command_Permission_Enable = Command_Permission_Enable;
|
||||
this.GUI_Slots = GUI_Slots;
|
||||
}
|
||||
}
|
@@ -0,0 +1,158 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Slot {
|
||||
|
||||
public Integer Slot;
|
||||
public Boolean Enable;
|
||||
// public Boolean ItemsRemovable;
|
||||
public Boolean Empty;
|
||||
public Integer ItemAmount;
|
||||
public Boolean PlayerHead_Enable;
|
||||
public Boolean Base64_Enable;
|
||||
public String Base64Value;
|
||||
public Boolean PlayerWhoHasOpenedTheGUI;
|
||||
public String PlayerName;
|
||||
public String Item;
|
||||
public String Name;
|
||||
public List Lore;
|
||||
public Boolean CustomSound_Enable;
|
||||
public Boolean CustomSound_NoSound;
|
||||
public String CustomSound_Sound;
|
||||
public Boolean Cost_Enable;
|
||||
public Double Price;
|
||||
public Boolean Command_Enable;
|
||||
public Boolean Command_BungeeCommand;
|
||||
public Boolean CommandAsConsole;
|
||||
public Boolean ServerChange;
|
||||
public String ServerChangeServer;
|
||||
public List<String> Command;
|
||||
public Boolean OpenGUI_Enable;
|
||||
public String OpenGUI;
|
||||
public Boolean Message_Enable;
|
||||
public List<String> Message;
|
||||
public Boolean Perm;
|
||||
public Boolean SetConfigEnable;
|
||||
public String ConfigFilePath;
|
||||
public String ConfigOptionPath;
|
||||
public String ConfigOptionPremat;
|
||||
// public Boolean ConfigChatInput;
|
||||
|
||||
public String ConfigStringValueLeft;
|
||||
public Boolean ConfigBooleanValueLeft;
|
||||
public Integer ConfigIntegerValueLeft;
|
||||
public Double ConfigDoubleValueLeft;
|
||||
public List<String> ConfigListValueLeft;
|
||||
|
||||
public String ConfigStringValueRight;
|
||||
public Boolean ConfigBooleanValueRight;
|
||||
public Integer ConfigIntegerValueRight;
|
||||
public Double ConfigDoubleValueRight;
|
||||
public List<String> ConfigListValueRight;
|
||||
|
||||
|
||||
public Boolean PluginReloadEnable;
|
||||
public String PluginReloadCommand;
|
||||
|
||||
public Slot(Integer Slot,
|
||||
Boolean Enable,
|
||||
// Boolean ItemsRemovable,
|
||||
Boolean Empty,
|
||||
Integer ItemAmount,
|
||||
Boolean PlayerHead_Enable,
|
||||
Boolean Base64Value_Enable,
|
||||
String Base64Value,
|
||||
Boolean PlayerWhoHasOpenedTheGUI,
|
||||
String PlayerName,
|
||||
String Item,
|
||||
String Name,
|
||||
List Lore,
|
||||
Boolean CustomSound_Enable,
|
||||
Boolean CustomSound_NoSound,
|
||||
String CustomSound_Sound,
|
||||
Boolean Cost_Enable,
|
||||
Double Price,
|
||||
Boolean Command_Enable,
|
||||
Boolean Command_BungeeCommand,
|
||||
Boolean CommandAsConsole,
|
||||
List<String> Command,
|
||||
Boolean ServerChange,
|
||||
String ServerChangeServer,
|
||||
Boolean OpenGUI_Enable,
|
||||
String OpenGUI,
|
||||
Boolean Message_Enable,
|
||||
List<String> Message,
|
||||
Boolean Perm,
|
||||
Boolean SetConfigEnable,
|
||||
String ConfigFilePath,
|
||||
String ConfigOptionPath,
|
||||
String ConfigOptionPremat,
|
||||
// Boolean ConfigChatInput,
|
||||
|
||||
String ConfigStringValueLeft,
|
||||
Boolean ConfigBooleanValueLeft,
|
||||
Integer ConfigIntegerValueLeft,
|
||||
Double ConfigDoubleValueLeft,
|
||||
List<String> ConfigListValueLeft,
|
||||
|
||||
String ConfigStringValueRight,
|
||||
Boolean ConfigBooleanValueRight,
|
||||
Integer ConfigIntegerValueRight,
|
||||
Double ConfigDoubleValueRight,
|
||||
List<String> ConfigListValueRight,
|
||||
|
||||
Boolean PluginReloadEnable,
|
||||
String PluginReloadCommand) {
|
||||
this.Slot = Slot;
|
||||
this.Enable = Enable;
|
||||
// this.ItemsRemovable = ItemsRemovable;
|
||||
this.Empty = Empty;
|
||||
this.ItemAmount = ItemAmount;
|
||||
this.PlayerHead_Enable = PlayerHead_Enable;
|
||||
this.Base64_Enable = Base64Value_Enable;
|
||||
this.Base64Value = Base64Value;
|
||||
this.PlayerWhoHasOpenedTheGUI = PlayerWhoHasOpenedTheGUI;
|
||||
this.PlayerName = PlayerName;
|
||||
this.Item = Item;
|
||||
this.Name = Name;
|
||||
this.Lore = Lore;
|
||||
this.CustomSound_Enable = CustomSound_Enable;
|
||||
this.CustomSound_NoSound = CustomSound_NoSound;
|
||||
this.CustomSound_Sound = CustomSound_Sound;
|
||||
this.Cost_Enable = Cost_Enable;
|
||||
this.Price = Price;
|
||||
this.Command_Enable = Command_Enable;
|
||||
this.Command_BungeeCommand = Command_BungeeCommand;
|
||||
this.CommandAsConsole = CommandAsConsole;
|
||||
this.Command = Command;
|
||||
this.ServerChange = ServerChange;
|
||||
this.ServerChangeServer = ServerChangeServer;
|
||||
this.OpenGUI_Enable = OpenGUI_Enable;
|
||||
this.OpenGUI = OpenGUI;
|
||||
this.Message_Enable = Message_Enable;
|
||||
this.Message = Message;
|
||||
this.Perm = Perm;
|
||||
this.SetConfigEnable = SetConfigEnable;
|
||||
this.ConfigFilePath = ConfigFilePath;
|
||||
this.ConfigOptionPath = ConfigOptionPath;
|
||||
this.ConfigOptionPremat = ConfigOptionPremat;
|
||||
// this.ConfigChatInput = ConfigChatInput;
|
||||
|
||||
this.ConfigStringValueLeft = ConfigStringValueLeft;
|
||||
this.ConfigBooleanValueLeft = ConfigBooleanValueLeft;
|
||||
this.ConfigIntegerValueLeft = ConfigIntegerValueLeft;
|
||||
this.ConfigDoubleValueLeft = ConfigDoubleValueLeft;
|
||||
this.ConfigListValueLeft = ConfigListValueLeft;
|
||||
|
||||
this.ConfigStringValueRight = ConfigStringValueRight;
|
||||
this.ConfigBooleanValueRight = ConfigBooleanValueRight;
|
||||
this.ConfigIntegerValueRight = ConfigIntegerValueRight;
|
||||
this.ConfigDoubleValueRight = ConfigDoubleValueRight;
|
||||
this.ConfigListValueRight = ConfigListValueRight;
|
||||
|
||||
|
||||
this.PluginReloadEnable = PluginReloadEnable;
|
||||
this.PluginReloadCommand = PluginReloadCommand;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user