config change for useItems
This commit is contained in:
parent
6fefa8701e
commit
9059790a65
@ -2,14 +2,10 @@ package net.t2code.commandguiv2.Spigot.config.configConverter;
|
|||||||
|
|
||||||
import net.t2code.commandguiv2.Spigot.Main;
|
import net.t2code.commandguiv2.Spigot.Main;
|
||||||
import net.t2code.commandguiv2.Spigot.config.config.Config;
|
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 org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
|
|
||||||
public class ConfigConverterV6 {
|
public class ConfigConverterV6 {
|
||||||
|
|
||||||
@ -21,9 +17,12 @@ public class ConfigConverterV6 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private File configOldRename;
|
private File configOld;
|
||||||
private YamlConfiguration yamlConfigurationOld;
|
private YamlConfiguration yamlConfigurationOld;
|
||||||
|
|
||||||
|
private File defaultUseItem = new File(Main.getPath(), "UseItems/default.yml");
|
||||||
|
private YamlConfiguration yamlConfigurationUseItem = YamlConfiguration.loadConfiguration(defaultUseItem);
|
||||||
|
|
||||||
private void convert() throws IOException {
|
private void convert() throws IOException {
|
||||||
|
|
||||||
|
|
||||||
@ -31,8 +30,8 @@ public class ConfigConverterV6 {
|
|||||||
File newF = new File("plugins/T2C-CommandGUI/configV5.yml");
|
File newF = new File("plugins/T2C-CommandGUI/configV5.yml");
|
||||||
oldF.renameTo(newF);
|
oldF.renameTo(newF);
|
||||||
|
|
||||||
configOldRename = new File(Main.getPath(), "configV5.yml");
|
configOld = new File(Main.getPath(), "configV5.yml");
|
||||||
yamlConfigurationOld = YamlConfiguration.loadConfiguration(configOldRename);
|
yamlConfigurationOld = YamlConfiguration.loadConfiguration(configOld);
|
||||||
set(Config.debug, "Plugin.Debug");
|
set(Config.debug, "Plugin.Debug");
|
||||||
|
|
||||||
set(Config.updateCheckOnJoin, "Plugin.updateCheck.onJoin");
|
set(Config.updateCheckOnJoin, "Plugin.updateCheck.onJoin");
|
||||||
|
201
CommandGUI V2/src/main/resources/UseItems/useItemDeclaration.yml
Normal file
201
CommandGUI V2/src/main/resources/UseItems/useItemDeclaration.yml
Normal file
@ -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 <on/off>'.
|
||||||
|
# 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 <slot>'.
|
||||||
|
# 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
|
@ -2,72 +2,65 @@
|
|||||||
#########################################
|
#########################################
|
||||||
## Please do not change ConfigVersion! ##
|
## Please do not change ConfigVersion! ##
|
||||||
#########################################
|
#########################################
|
||||||
ConfigVersion: 5
|
configVersion: 6
|
||||||
|
|
||||||
Plugin:
|
plugin:
|
||||||
# Here you can set the debug mode of the 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!
|
# 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.
|
# Here you can set whether the Helpalias command (/commandguihelp) should be activated.
|
||||||
# If this is changed the server MUST be restarted to change this!
|
# 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.
|
# Here you set which subcommand should be for the admin functions.
|
||||||
# (/commandgui 'admin' reload)
|
# (/commandgui 'admin' reload)
|
||||||
AdminSubCommand: admin
|
adminSubCommand: admin
|
||||||
# here you set the language to be used
|
# here you set the language to be used
|
||||||
language: english
|
language: english
|
||||||
# Here you set the character or word that will be used as currency
|
# 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'.
|
# 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.
|
# 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
|
# Enter here the access data to the database you want to use, if you use MySQL
|
||||||
MySQL:
|
mySQL:
|
||||||
IP: localhost
|
ip: localhost
|
||||||
Port: 3306
|
port: 3306
|
||||||
Database: database
|
database: database
|
||||||
User: root
|
user: root
|
||||||
Password: password
|
password: password
|
||||||
SSL: false
|
ssl: false
|
||||||
|
|
||||||
BungeeCord:
|
useItem:
|
||||||
# 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:
|
|
||||||
# Set here if the UseItem is to be used in use
|
# 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 <on/off>'.
|
# Set here if players are allowed to enable or disable the UseItem with '/gui-item <on/off>'.
|
||||||
# Permission 'commandgui.useitem.toggle' is additionally required
|
# 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 <slot>'.
|
# Set here if players are allowed to change the slot in the inventory where the UseItem is located with '/gui-item <slot>'.
|
||||||
# Permission 'commandgui.useitem.toggle' is additionally required
|
# Permission 'commandgui.useitem.toggle' is additionally required
|
||||||
AllowSetSlot: true
|
allowSetSlot: true
|
||||||
# Set here if the dropping of the UseItem should be blocked
|
# Set here if the dropping of the UseItem should be blocked
|
||||||
BlockMoveAndDrop: true
|
blockMoveAndDrop: true
|
||||||
# Set here which GUI should open the UseItem
|
# Set here which GUI should open the UseItem
|
||||||
OpenGUI: default
|
openGUI: default
|
||||||
Permission:
|
permission:
|
||||||
# Set here if the permission 'commandgui.useitem' is required to use the UseItem
|
# 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
|
# Set here if the UseItem should stay in the inventory with the '/clear' command
|
||||||
KeepAtCommandClear: true
|
keepAtCommandClear: true
|
||||||
InventorySlot:
|
inventorySlot:
|
||||||
# Set here on which slot the UseItem should be located by default
|
# 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).
|
# 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.
|
# 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.
|
# 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
|
# Set here the item that should be used as UseItem
|
||||||
Item:
|
item:
|
||||||
# Set here which material should be used as UseItem
|
# Set here which material should be used as UseItem
|
||||||
Material: paper
|
Material: paper
|
||||||
PlayerHead:
|
PlayerHead:
|
||||||
@ -168,42 +161,33 @@ Sound:
|
|||||||
Enable: true
|
Enable: true
|
||||||
Sound: BLOCK_NOTE_BLOCK_HARP
|
Sound: BLOCK_NOTE_BLOCK_HARP
|
||||||
|
|
||||||
Advanced:
|
useItemSettings:
|
||||||
UseItem:
|
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:
|
GameMode:
|
||||||
Change:
|
Change:
|
||||||
# Set here if the UseItem should be reset when the GameMode is changed.
|
# Set here if the UseItem should be reset when the GameMode is changed.
|
||||||
Enable: true
|
Enable: true
|
||||||
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
|
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
|
||||||
DelayInTicks: 1
|
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:
|
World:
|
||||||
Change:
|
Change:
|
||||||
# This specifies whether the UseItem should be reset when the world is changed.
|
# This specifies whether the UseItem should be reset when the world is changed.
|
||||||
Enable: true
|
Enable: true
|
||||||
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
|
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
|
||||||
DelayInTicks: 1
|
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.
|
# Set here for which blocks the UseItem is blocked and the function of the block you are looking at should be used.
|
||||||
ItemBlockBlacklist:
|
ItemBlockBlacklist:
|
||||||
- CHEST
|
- CHEST
|
||||||
|
Loading…
Reference in New Issue
Block a user