diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverterV6.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverterV6.java index d7f05bc..c6bbd4f 100644 --- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverterV6.java +++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverterV6.java @@ -2,14 +2,10 @@ package net.t2code.commandguiv2.Spigot.config.configConverter; import net.t2code.commandguiv2.Spigot.Main; import net.t2code.commandguiv2.Spigot.config.config.Config; -import net.t2code.commandguiv2.Util; -import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace; import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; public class ConfigConverterV6 { @@ -21,9 +17,12 @@ public class ConfigConverterV6 { } } - private File configOldRename; + private File configOld; private YamlConfiguration yamlConfigurationOld; + private File defaultUseItem = new File(Main.getPath(), "UseItems/default.yml"); + private YamlConfiguration yamlConfigurationUseItem = YamlConfiguration.loadConfiguration(defaultUseItem); + private void convert() throws IOException { @@ -31,8 +30,8 @@ public class ConfigConverterV6 { File newF = new File("plugins/T2C-CommandGUI/configV5.yml"); oldF.renameTo(newF); - configOldRename = new File(Main.getPath(), "configV5.yml"); - yamlConfigurationOld = YamlConfiguration.loadConfiguration(configOldRename); + configOld = new File(Main.getPath(), "configV5.yml"); + yamlConfigurationOld = YamlConfiguration.loadConfiguration(configOld); set(Config.debug, "Plugin.Debug"); set(Config.updateCheckOnJoin, "Plugin.updateCheck.onJoin"); diff --git a/CommandGUI V2/src/main/resources/UseItems/useItemDeclaration.yml b/CommandGUI V2/src/main/resources/UseItems/useItemDeclaration.yml new file mode 100644 index 0000000..4a33ef9 --- /dev/null +++ b/CommandGUI V2/src/main/resources/UseItems/useItemDeclaration.yml @@ -0,0 +1,201 @@ +useItem: + # Set here if the UseItem is to be used in use + enable: true + # Set here if players are allowed to enable or disable the UseItem with '/gui-item '. + # Permission 'commandgui.useitem.toggle' is additionally required + allowToggle: true + # Set here if players are allowed to change the slot in the inventory where the UseItem is located with '/gui-item '. + # Permission 'commandgui.useitem.toggle' is additionally required + allowSetSlot: true + # Set here if the dropping of the UseItem should be blocked + blockMoveAndDrop: true + # Set here which GUI should open the UseItem + openGUI: default + permission: + # Set here if the permission 'commandgui.useitem' is required to use the UseItem + neededToUse: true + # Set here if the UseItem should stay in the inventory with the '/clear' command + keepAtCommandClear: true + inventorySlot: + # Set here on which slot the UseItem should be located by default + slot: 1 + # Set here if the slot should be forced even if another item is on this slot (also the set slot of the player). + # NOTE: The item that was on this slot before will be deleted. + slotEnforce: false + # Set here if the UseItem should be placed on another free slot, if the selected slot (also the set slot of the player) is occupied. + freeSlot: false + # Set here the item that should be used as UseItem + item: + # Set here which material should be used as UseItem + material: paper + playerHead: + # Set here if a PlayerHead should be used as UseItem + enable: false + base64: + # Set here if a Base64 PlayerHead should be used as UseItem + enable: false + # Here you can set the Base64 Value. + # You can find the Base64 Value for example on https://minecraft-heads.com. + base64Value: '' + # Here you can set whether the player head should be used as a UseItem by the player + playerWhoHasOpenedTheGUI: false + # Here you can set a player name whose head should be used as UseItem + playerName: '' + # Set the DisplayName of the UseItem here + name: '&6GUI UseItem' + # Set the lore of the UseItem here + lore: + - 'Lore line 1' + - 'Lore line 2' + join: + # Set here if the UseItem should be given at every server join + giveOnEveryJoin: true + # Set here if the UseItem should only be given to the server at the first join of the player. + giveOnlyOnFirstJoin: false + quit: + removeOnQuit: false + protection: + gameMode: + enable: false + removeItemWhenItIsDisabled: false + mode: blacklist + list: + - CREATIVE + - Spectator + world: + enable: false + removeItemWhenItIsDisabled: false + mode: blacklist + list: + - World1 + - World2 + +useItemSettings: + cursor: + toGUIItem: + useItem: default + onLogin: + # Here you define whether the UseItem should be selected when joining the server. + enable: true + spigot: + # Set here if the UseItem should only be selected at the first join + onOnlyFirstLogin: true + bungee: + # Set here if the UseItem should be selected even if you change the server of the bungee network. + # The option BungeeCord must be activated for this! + onServerChange: false + gameMode: + change: + enable: true + delayInTicks: 1 + world: + change: + enable: true + delayInTicks: 1 + disablePluginInfoBySneak: false + itemBlockBlacklist: + - CHEST + - CRAFTING_TABLE + - FURNACE + - OAK_FENCE + - SPRUCE_FENCE + - BIRCH_FENCE + - JUNGLE_FENCE + - ACACIA_FENCE + - DARK_OAK_FENCE + - MANGROVE_FENCE + - CRIMSON_FENCE + - WARPED_FENCE + - NETHER_BRICK_FENCE + - ENDER_CHEST + - BEACON + - ANVIL + - CHIPPED_ANVIL + - DAMAGED_ANVIL + - REPEATER + - COMPARATOR + - HOPPER + - DISPENSER + - DROPPER + - LEVER + - DAYLIGHT_DETECTOR + - TRAPPED_CHEST + - NOTE_BLOCK + - STONE_BUTTON + - POLISHED_BLACKSTONE_BUTTON + - OAK_BUTTON + - SPRUCE_BUTTON + - BIRCH_BUTTON + - JUNGLE_BUTTON + - ACACIA_BUTTON + - DARK_OAK_BUTTON + - MANGROVE_BUTTON + - CRIMSON_BUTTON + - WARPED_BUTTON + - IRON_DOOR + - OAK_DOOR + - SPRUCE_DOOR + - BIRCH_DOOR + - JUNGLE_DOOR + - ACACIA_DOOR + - DARK_OAK_DOOR + - MANGROVE_DOOR + - CRIMSON_DOOR + - WARPED_DOOR + - IRON_TRAPDOOR + - IRON_TRAPDOOR + - OAK_TRAPDOOR + - OAK_TRAPDOOR + - SPRUCE_TRAPDOOR + - SPRUCE_TRAPDOOR + - BIRCH_TRAPDOOR + - BIRCH_TRAPDOOR + - JUNGLE_TRAPDOOR + - JUNGLE_TRAPDOOR + - ACACIA_TRAPDOOR + - ACACIA_TRAPDOOR + - DARK_OAK_TRAPDOOR + - DARK_OAK_TRAPDOOR + - MANGROVE_TRAPDOOR + - MANGROVE_TRAPDOOR + - CRIMSON_TRAPDOOR + - CRIMSON_TRAPDOOR + - WARPED_TRAPDOOR + - WARPED_TRAPDOOR + - OAK_FENCE_GATE + - SPRUCE_FENCE_GATE + - BIRCH_FENCE_GATE + - JUNGLE_FENCE_GATE + - ACACIA_FENCE_GATE + - DARK_OAK_FENCE_GATE + - MANGROVE_FENCE_GATE + - CRIMSON_FENCE_GATE + - WARPED_FENCE_GATE + - CHEST_MINECART + - FURNACE_MINECART + - HOPPER_MINECART + - OAK_CHEST_BOAT + - SPRUCE_CHEST_BOAT + - BIRCH_CHEST_BOAT + - JUNGLE_CHEST_BOAT + - ACACIA_CHEST_BOAT + - DARK_OAK_CHEST_BOAT + - MANGROVE_CHEST_BOAT + - LEATHER_CHESTPLATE + - CHAINMAIL_CHESTPLATE + - IRON_CHESTPLATE + - DIAMOND_CHESTPLATE + - GOLDEN_CHESTPLATE + - NETHERITE_CHESTPLATE + - BREWING_STAND + - LOOM + - COMPOSTER + - BARREL + - SMOKER + - BLAST_FURNACE + - BLAST_FURNACE + - CARTOGRAPHY_TABLE + - FLETCHING_TABLE + - GRINDSTONE + - SMITHING_TABLE + - STONECUTTER \ No newline at end of file diff --git a/CommandGUI V2/src/main/resources/configDeclaration.yml b/CommandGUI V2/src/main/resources/configDeclaration.yml index 681eb67..dad7f2a 100644 --- a/CommandGUI V2/src/main/resources/configDeclaration.yml +++ b/CommandGUI V2/src/main/resources/configDeclaration.yml @@ -2,72 +2,65 @@ ######################################### ## Please do not change ConfigVersion! ## ######################################### -ConfigVersion: 5 +configVersion: 6 -Plugin: +plugin: # Here you can set the debug mode of the plugin. # It is recommended not to activate this on productive systems. Only if it is really needed! - Debug: false + debug: false # Here you can set whether the Helpalias command (/commandguihelp) should be activated. # If this is changed the server MUST be restarted to change this! - HelpAlias: true + helpAlias: true # Here you set which subcommand should be for the admin functions. # (/commandgui 'admin' reload) - AdminSubCommand: admin + adminSubCommand: admin # here you set the language to be used language: english # Here you set the character or word that will be used as currency - Currency: $ + currency: $ # Here you set which GUI should be opened at '/commandgui' / '/gui'. - DefaultGUI: default + defaultGUI: default -Storage: +storage: # Set here if MySQL, SQLITE or YML should be used as storage. - Type: SQLITE + type: SQLITE # Enter here the access data to the database you want to use, if you use MySQL - MySQL: - IP: localhost - Port: 3306 - Database: database - User: root - Password: password - SSL: false + mySQL: + ip: localhost + port: 3306 + database: database + user: root + password: password + ssl: false -BungeeCord: - # Set here if the plugin runs in a BungeeCord subserver. - # The plugin file must then be installed on the proxy (BungeeCord, Waterfall) and on the servers. - Enable: false - # Set here the server name of the server - ThisServer: server - -UseItem: +useItem: # Set here if the UseItem is to be used in use - Enable: true + enable: true # Set here if players are allowed to enable or disable the UseItem with '/gui-item '. # Permission 'commandgui.useitem.toggle' is additionally required - AllowToggle: true + allowToggle: true # Set here if players are allowed to change the slot in the inventory where the UseItem is located with '/gui-item '. # Permission 'commandgui.useitem.toggle' is additionally required - AllowSetSlot: true + allowSetSlot: true # Set here if the dropping of the UseItem should be blocked - BlockMoveAndDrop: true + blockMoveAndDrop: true # Set here which GUI should open the UseItem - OpenGUI: default - Permission: + openGUI: default + permission: # Set here if the permission 'commandgui.useitem' is required to use the UseItem - NeededToUse: true + neededToUse: true # Set here if the UseItem should stay in the inventory with the '/clear' command - KeepAtCommandClear: true - InventorySlot: + keepAtCommandClear: true + inventorySlot: # Set here on which slot the UseItem should be located by default - Slot: 1 + slot: 1 # Set here if the slot should be forced even if another item is on this slot (also the set slot of the player). # NOTE: The item that was on this slot before will be deleted. - SlotEnforce: false + slotEnforce: false # Set here if the UseItem should be placed on another free slot, if the selected slot (also the set slot of the player) is occupied. - FreeSlot: false + freeSlot: false # Set here the item that should be used as UseItem - Item: + item: # Set here which material should be used as UseItem Material: paper PlayerHead: @@ -168,44 +161,35 @@ Sound: Enable: true Sound: BLOCK_NOTE_BLOCK_HARP -Advanced: - UseItem: - GameMode: - Change: - # Set here if the UseItem should be reset when the GameMode is changed. - Enable: true - # Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second). - DelayInTicks: 1 - Protection: - # Set here in which gamemode the UseItem may be used - Enable: false - # Set here if the UseItem should be removed if you are in a not allowed Gamemode - RemoveItemWhenItIsDisabled: false - # Set here if a 'blacklist' or 'whitelist' should be used - Mode: blacklist - # Set the GameMode list here - List: - - CREATIVE - - Spectator - World: - Change: - # This specifies whether the UseItem should be reset when the world is changed. - Enable: true - # Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second). - DelayInTicks: 1 - Protection: - # Set here in which world the UseItem may be used - Enable: false - # Here you specify whether the UseItem should be removed if you are in a world that is not permitted - RemoveItemWhenItIsDisabled: false - # Set here if a 'blacklist' or 'whitelist' should be used - Mode: blacklist - # Set the worlds here - List: - - World1 - - World2 - # Set here for which blocks the UseItem is blocked and the function of the block you are looking at should be used. - ItemBlockBlacklist: +useItemSettings: + cursor: + toGUIItem: + # useItem: Here you define on which UseItem the cursor should be set. + useItem: default + onLogin: + # Here you define whether the UseItem should be selected when joining the server. + enable: true + spigot: + # Set here if the UseItem should only be selected at the first join + onOnlyFirstLogin: true + bungee: + # Set here if the UseItem should be selected even if you change the server of the bungee network. + # The option BungeeCord must be activated for this! + onServerChange: false + GameMode: + Change: + # Set here if the UseItem should be reset when the GameMode is changed. + Enable: true + # Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second). + DelayInTicks: 1 + World: + Change: + # This specifies whether the UseItem should be reset when the world is changed. + Enable: true + # Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second). + DelayInTicks: 1 + # Set here for which blocks the UseItem is blocked and the function of the block you are looking at should be used. + ItemBlockBlacklist: - CHEST - CRAFTING_TABLE - FURNACE