9 Commits
2.7.0 ... 2.7.1

Author SHA1 Message Date
a05b941aaf 2.7.1 | Bug fixes
Bug fixes:
- When sneaking and using the UseItem, an error occurred.
- The config.yml was not reloaded on '/commandgui admin reload' and the change was rolled back
- The command '/gui-item slot <slot>' was calculated incorrectly and it often came the message that the selected slot was occupied although it was not.
2022-05-12 18:28:35 +02:00
36de2ff0ca Small bugfix 2022-05-03 19:23:17 +02:00
JaTiTV
777c6876fc Merge pull request '2.7.0' (#8) from 2.7.0 into main
Reviewed-on: JaTiTV/CommandGUI#8
2022-04-28 19:55:33 +02:00
7fda797cae remove config poll 2022-04-19 07:15:09 +02:00
007d8776b9 update default config to V5 2022-04-19 07:14:35 +02:00
JaTiTV
dcd524ab3c „Config poll/new/GUIs/default.yml“ ändern 2022-04-19 00:45:40 +02:00
JaTiTV
c3d0990853 „Config poll/new/Functions/SupportDiscord.yml“ ändern 2022-04-19 00:13:25 +02:00
JaTiTV
04a7d4952e „Config poll/new/Functions/SupportDiscord.yml“ ändern 2022-04-19 00:13:11 +02:00
d96205887c Config poll 2022-04-16 15:46:26 +02:00
13 changed files with 268 additions and 96 deletions

View File

@@ -6,7 +6,7 @@
<groupId>net.t2code</groupId>
<artifactId>CommandGUI_V2</artifactId>
<version>2.7.0</version>
<version>2.7.1</version>
<packaging>jar</packaging>
<name>CommandGUI</name>

View File

@@ -53,6 +53,7 @@ public class ItemChange {
new BukkitRunnable() {
@Override
public void run() {
if (player == null) return;
if (!SelectConfig.UseItem_AllowToggle || Events.useItemHashMap.get(player)) {
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
send.debug(Main.plugin, "Give: " + player.getName());

View File

@@ -160,7 +160,7 @@ public class Events implements Listener {
private static void openGUI(PlayerInteractEvent e, Player player) {
e.setCancelled(true);
if (SelectConfig.disableInfoBySneak && player.isSneaking()) {
if ((!SelectConfig.disableInfoBySneak) && player.isSneaking()) {
Commands.info(player);
return;
}
@@ -211,7 +211,6 @@ public class Events implements Listener {
if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName()
&& e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
e.setCancelled(true);
}
}

View File

@@ -65,14 +65,14 @@ public class Commands {
CmdExecuter_GUITab.arg1.clear();
CmdExecuter_GUITab.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
ConfigCreate.configCreate();
SelectConfig.onSelect();
SelectConfig.onSelect();
Main.plugin.reloadConfig();
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.storage)) {
if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
send.console("You have changed the storage medium! To apply this change, you must restart the server!");
}
LanguagesCreate.langCreate();
Obj_Select.onSelect();
@@ -161,7 +161,11 @@ public class Commands {
}
public static void onSetSlot(Player player, Integer setSlot) {
if (SelectConfig.UseItem_AllowSetSlot) {
if (!SelectConfig.UseItem_AllowSetSlot) {
player.sendMessage(Util.getPrefix() + " §4Function disabled");
return;
}
if (setSlot < 1) {
send.player(player, SelectMessages.ItemSlot_wrongValue);
return;
@@ -170,27 +174,28 @@ public class Commands {
send.player(player, SelectMessages.ItemSlot_wrongValue);
return;
}
ItemStack itm1 = player.getInventory().getItem(setSlot + 1);
if (itm1 != null) {
if (itm1.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm1.getType() == ItemVersion.getHead()) {
if (itm1.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
if (Events.useItemHashMap.get(player)) {
if (Objects.equals(Events.useItemSlotHashMap.get(player), setSlot)) {
player.sendMessage(SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
return;
}
}
}
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(setSlot - 1) != null) {
send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
return;
}
UseItem.removeItem(player);
SelectDatabase.setSlot(player, setSlot);
Events.useItemSlotHashMap.replace(player, setSlot);
if (Events.useItemHashMap.get(player)) {
UseItem.giveUseItem(player);
}
send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
} else player.sendMessage(Util.getPrefix() + " §4Function disabled");
}
public static void gui(Player player) {

View File

@@ -19,9 +19,6 @@ import java.util.ArrayList;
import java.util.List;
public class SelectConfig {
private static final File config = new File(Main.getPath(), "config.yml");
private static final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
public static Boolean Debug;
public static Boolean HelpAlias;
public static String language;
@@ -61,7 +58,7 @@ public class SelectConfig {
public static String UseItemWorldMode;
public static List<String> UseItemWorldList;
public static Boolean disableInfoBySneak;
public static Boolean disableInfoBySneak = false;
public static Boolean UseItem_InventorySlot_FreeSlot;
public static Integer UseItem_InventorySlot;
@@ -117,6 +114,9 @@ public class SelectConfig {
public static void onSelect() {
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
if (yamlConfiguration.getInt("ConfigVersion") < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
send.console(Util.getPrefix() + " §4----------------------");
send.console(Util.getPrefix() + " ");
@@ -221,7 +221,6 @@ public class SelectConfig {
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
setConfigVersion();
}
@@ -345,7 +344,9 @@ public class SelectConfig {
}
private static void setConfigVersion() {
public static void setConfigVersion() {
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
yamlConfiguration.set("ConfigVersion", Util.getConfigVersion());
try {
yamlConfiguration.save(config);

View File

@@ -69,6 +69,8 @@ public class Load {
e.printStackTrace();
}
SelectConfig.setConfigVersion();
if (SelectConfig.Bungee) {
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "cgui:bungee")) {
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");

View File

@@ -1,19 +1,8 @@
GUI:
Enable: true
Lines: 1
Name: '&5default &9GUI'
FillItem:
Enable: true
Item: BLACK_STAINED_GLASS_PANE
Command:
Alias: true
Permission:
Required: true
Slots:
Example:
Slot: 5
Enable: true
Function:
Item:
Empty: false
Amount: 1
PlayerHead:
Enable: true
Base64:
@@ -31,9 +20,10 @@ Slots:
- '&eIf you find any errors or bugs,'
- '&eplease contact me so I can fix them.'
- '&8-----------------'
- '&5Discord: §7https://discord.gg/vRyXFFterJ'
- '&5Discord: §7http://dc.t2code.net'
CustomSound:
Enable: false
NoSound: false
Sound: ''
Cost:
Enable: false
@@ -42,17 +32,43 @@ Slots:
Enable: false
BungeeCommand: false
CommandAsConsole: false
Command:
- ''
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: false
Message:
Enable: true
Message:
- '&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ'
Permission:
Required: false
- '&6You can find more information on Discord: &ehttp://dc.t2code.net'
SetConfig:
Enable: false
File:
Path: ''
Option:
Path: ''
Premat: String
Value:
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
Enable: false
Command: ''

View File

@@ -0,0 +1,67 @@
Slots:
Function:
Item:
Empty: false
Amount: 1
PlayerHead:
Enable: false
Base64:
Enable: false
Base64Value: ''
PlayerWhoHasOpenedTheGUI: false
PlayerName: ''
Material: ''
Name: '&6Toggle UseItem'
Lore:
- '&bYou currently have the UseItem set to: %commandgui_useitem%'
CustomSound:
Enable: false
NoSound: false
Sound: ''
Cost:
Enable: false
Price: 0.0
Command:
Enable: false
BungeeCommand: false
CommandAsConsole: false
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: true
Message:
Enable: true
Message:
- '&bYour UseItem was set to: %commandgui_useitem%&b.'
SetConfig:
Enable: false
File:
Path: ''
Option:
Path: ''
Premat: String
Value:
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
Enable: false
Command: ''

View File

@@ -0,0 +1,28 @@
GUI:
Enable: true
Lines: 1
Name: '&5default &9GUI'
FillItem:
Enable: true
Item: BLACK_STAINED_GLASS_PANE
Command:
Alias: true
Permission:
Required: true
Slots:
SupportDiscord:
Slot: 4
Enable: true
Function: SupportDiscord
Permission:
Required: false
See: commandgui.gui.[guiname].slot.[slot].see
Use: commandgui.gui.[guiname].slot.[slot].use
UseItem:
Slot: 6
Enable: true
Function: UseItem
Permission:
Required: false
See: commandgui.gui.[guiname].slot.[slot].see
Use: commandgui.gui.[guiname].slot.[slot].use

View File

@@ -1,3 +1,4 @@
ConfigVersion: 5
Plugin:
UpdateCheckOnJoin: true
Debug: false
@@ -25,6 +26,7 @@ UseItem:
OpenGUI: default
Permission:
NeededToUse: true
KeepAtCommandClear: true
InventorySlot:
Slot: 1
SlotEnforce: false
@@ -46,9 +48,57 @@ UseItem:
GiveOnlyOnFirstJoin: false
Cursor:
ToGUIItem:
OnEveryLogin: true
OnLogin:
Enable: true
Spigot:
OnOnlyFirstLogin: true
EXPERIMENTELL_ServerChhange: false
Bungee:
OnServerChange: false
Advanced:
UseItem:
GameMode:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- CREATIVE
- Spectator
World:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- World1
- World2
Toggle:
Items:
OnOrYes:
Item:
Base64:
Enable: false
Base64Value: ''
Material: GREEN_WOOL
OffOrNo:
Item:
Base64:
Enable: false
Base64Value: ''
Material: RED_WOOL
Permission:
Commands:
'True': luckperms user [player] permission set [perm] true
'False': luckperms user [player] permission set [perm] false
Placeholder:
'True': '&2true'
'False': '&4false'
Sound:
Enable: true
OpenInventory:

View File

@@ -4,13 +4,11 @@ Plugin:
settings.'
OnlyForPlayer: '[prefix] &cThis command is for players only!'
DefaultGUI:
create: '[prefix] &2DefaultGUI was created. You can find it in the directory::
create: '[prefix] &2DefaultGUI was created. You can find it in the directory:
&e[directory]&2!'
Reload:
Start: '[prefix] &6Plugin is reloaded...'
End: '[prefix] &2Plugin was successfully reloaded.'
Warning: '[prefix] &6To enable / disable alias commands, reload / restart the
server!'
NoPermission:
ForCommandGUI: '[prefix] &cYou do not have permission for &4Command&9GUI&c!'
ForCommand: '[prefix] &cFor &b[cmd] &cyou lack the permission &6[perm]&c!'
@@ -24,6 +22,8 @@ UseItem:
SlotNotEmpty: '[prefix] &6The slot &e[slot] &6is currently occupied!'
SlotAlreadySet: '[prefix] &6The slot §e[slot] §6is already set!'
ItemSlot_wrongValue: '[prefix] &cThe specified slot must be between 1 and 9!'
DisabledInGameMode: '[prefix] &cThe UseItem is disabled in this GameMode!'
DisabledInWorld: '[prefix] &cThe UseItem is disabled in this World!'
Cost:
Buy_msg: '[prefix] &2You bought [itemname] &2for &6[price]&2.'
No_money: '[prefix] &cYou don''t have enough money!'
@@ -42,7 +42,8 @@ Player:
Help:
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eOpen the default GUI &7(&r[gui]&7)&e.'
Help: '&8''''&b/commandguihelp&8'''' &eOpen this help.'
Info: '&8''''&b/commandguiadmin info&8'''' &eCall the info from &4Command&9GUI &e.'
Info: '&8''''&b/commandgui admin info&8'''' &eCall the info from &4Command&9GUI
&e.'
Open: '&8''''&b/commandgui [gui]&8'''' &eOpen the GUI: &6[guiname]&e.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGive a player the GUI item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eCreate a default

View File

@@ -8,8 +8,6 @@ Plugin:
Reload:
Start: '[prefix] &6Plugin wird neu geladen...'
End: '[prefix] &2Plugin wurde erfolgreich neu geladen.'
Warning: '[prefix] &6Um Alias-Befehle zu aktivieren / deaktivieren, lade / starte
den Server neu!!'
NoPermission:
ForCommandGUI: '[prefix] &cDu hast keine Permission f[ue]r &4Command&9GUI&c!'
ForCommand: '[prefix] &cF[ue]r &b[cmd] &cfehlt dir die Permission &6[perm]&c!'
@@ -24,6 +22,8 @@ UseItem:
SlotAlreadySet: '[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!'
ItemSlot_wrongValue: '[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9
befinden!'
DisabledInGameMode: '[prefix] &cDas UseItem ist in diesem GameMode deaktiviert!'
DisabledInWorld: '[prefix] &cDas UseItem ist in dieser Welt deaktiviert!'
Cost:
Buy_msg: '[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.'
No_money: '[prefix] &cDu hast nicht gen[ue]gend Geld!'
@@ -44,9 +44,11 @@ Player:
Help:
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.'
Help: '&8''''&b/commandguihelp&8'''' &e[OE]ffne diese help.'
Info: '&8''''&b/commandguiadmin info&8'''' &eRufe die Infos von &4Command&9GUI &eauf.'
Info: '&8''''&b/commandgui admin info&8'''' &eRufe die Infos von &4Command&9GUI
&eauf.'
Open: '&8''''&b/commandgui [gui]&8'''' &e[OE]ffne die GUI: &6[guiname]&e.'
Give: '&8''''&b/commandguiadmin give &7<player>&8'''' &eGebe einem Spieler das GUI-Item.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGebe einem Spieler das
GUI-Item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eLasse eine
default GUI erstellen &7([directory])&e.'
Reload: '&8''''&b/commandgui admin reload&8'''' &eLade das Plugin neu.'

View File

@@ -8,8 +8,6 @@ Plugin:
Reload:
Start: '[prefix] &6Pluginet blir relastet...'
End: '[prefix] &2Pluginet har blitt lastet inn på nytt.'
Warning: '[prefix] &6For å skru på / skru av alias kommandoer, relast / restart
serveren!'
NoPermission:
ForCommandGUI: '[prefix] &cDu har ikke tilgang til &4Command&9GUI&c!'
ForCommand: '[prefix] &cFor &b[cmd] &cmangler du tillatelsen &6[perm]&c!'
@@ -23,6 +21,8 @@ UseItem:
SlotNotEmpty: '[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!'
SlotAlreadySet: '[prefix] &6Plassen §e[slot] §6er allerede satt!'
ItemSlot_wrongValue: '[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!'
DisabledInGameMode: '[prefix] &cBrukselementet er deaktivert i denne spillmodusen!!'
DisabledInWorld: '[prefix] &cUseItem er deaktivert i denne verden!'
Cost:
Buy_msg: '[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.'
No_money: '[prefix] &cDu har ikke nok penger!'