Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniFoldi committed Jan 20, 2022
1 parent 15b88c7 commit cdc3473
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 198 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ___Expressions are evaluated in order___

**configVersion**

This should say `5`. If there are any config changes, the value will be incremented. The conversion process should be automatic, unless the release notes say otherwise.
This should say `6`. If there are any config changes, the value will be incremented. The conversion process should be automatic, unless the release notes say otherwise.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void onHelpCommand(@Source PlatformInteraction.ProtoSender sender) {
sender.send(Message.COMMAND_RELOAD);
sender.send(Message.COMMAND_SEND);
sender.send(Message.COMMAND_SOUND);
sender.send(Message.COMMAND_SUBTITLE);
sender.send(Message.COMMAND_SUDO);
sender.send(Message.COMMAND_TITLE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void load() {
placeholderHandler.registerBuiltins();

try {
FileUtil.ensureFolder(datafolder);
boolean newInstall = FileUtil.ensureFolder(datafolder);
FileUtil.ensureFolder(datafolder.resolve("actions"));
FileUtil.ensureFolder(datafolder.resolve("templates"));
FileUtil.ensureFolder(datafolder.resolve("guis"));
Expand All @@ -90,6 +90,13 @@ public void load() {

logger.setFilter(record -> newConfig.getEnumOrElse("logLevel", LogLevel.ALL, EnumGetMethod.NAME_IGNORECASE).level.intValue() <= record.getLevel().intValue());

if (newInstall) {
FileUtil.ensureConfigFile(datafolder.resolve("guis").resolve("authors.yml"), "authors.yml");
FileUtil.ensureConfigFile(datafolder.resolve("guis").resolve("servermenu.yml"), "servermenu.yml");
FileUtil.ensureConfigFile(datafolder.resolve("guis").resolve("sounds.yml"), "sounds.yml");
FileUtil.ensureConfigFile(datafolder.resolve("guis").resolve("stats.yml"), "stats.yml");
}

guiHandler.load(datafolder);
platform.setup();
} catch (IOException e) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/danifoldi/protogui/util/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ private static void upgrade(Path datafolder, int oldVersion, int newVersion) {
ensureValue(messages, "parameterMissingFlag", Message.PARAMETER_MISSING_FLAG.getDefaultValue());
ensureValue(messages, "parameterDuplicateFlag", Message.PARAMETER_DUPLICATE_FLAG.getDefaultValue());
ensureValue(messages, "parameterUnrecognizedCommandFlag", Message.PARAMETER_UNRECOGNIZED_COMMAND_FLAG.getDefaultValue());
ensureValue(messages, "commandSudo", Message.COMMAND_SUDO.getDefaultValue());
ensureValue(messages, "commandSubtitle", Message.COMMAND_SUBTITLE.getDefaultValue());

config.remove("messages");
Config actions = config.get("actions");
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/danifoldi/protogui/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public class FileUtil {
return config;
}

public static void ensureFolder(final @NotNull Path folder) throws IOException {
public static boolean ensureFolder(final @NotNull Path folder) throws IOException {
if (Files.notExists(folder)) {
Files.createDirectories(folder);
return true;
}
return false;
}

private FileUtil() {
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/danifoldi/protogui/util/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum Message {
COMMAND_SEND("commandSend", "&0- &6/bgui &lsend&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<server> &0- &7Send a player to a server"),
COMMAND_CHAT("commandChat", "&0- &6/bgui &lchat&r &6<player> &6<message> &0- &7Send a message to chat as a player"),
COMMAND_ACTIONBAR("commandActionbar", "&0- &6/bgui &lactionbar&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<text> &0- &7Show a player a message in their action bar"),
COMMAND_TITLE("commandTitle", "&0- &6/bgui &ltitle&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &7title&f|&7subtitle &6<fadeIn> &6<stay> &6<fadeOut> &6<message> &0- &7Send title to players"),
COMMAND_TITLE("commandTitle", "&0- &6/bgui &ltitle&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<fadeIn> &6<stay> &6<fadeOut> &6<message> &0- &7Send title to players"),
COMMAND_SOUND("commandSound", "&0- &6/bgui &lsound&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<sound> &6[category] &6[volume] &6[pitch] &0- &7Play a sound for players"),
COMMAND_OPEN("commandOpen", "&0- &6/bgui &lopen&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<gui> &6[target] &0- &7Open a GUI for players"),
COMMAND_CLOSE("commandClose", "&0- &6/bgui &lclose&r &6<player> &0- &7Close the GUI for players"),
Expand Down Expand Up @@ -61,7 +61,9 @@ public enum Message {
PARAMETER_MISSING_FLAG_VALUE("parameterMissingFlagValue", "&cMissing flag value: {input}"),
PARAMETER_MISSING_FLAG("parameterMissingFlag", "&cMissing flag: {syntax}"),
PARAMETER_DUPLICATE_FLAG("parameterDuplicateFlag", "&cDuplicate flag: {flag}"),
PARAMETER_UNRECOGNIZED_COMMAND_FLAG("parameterUnrecognizedCommandFlag", "&cUnrecognized flag: {input}");
PARAMETER_UNRECOGNIZED_COMMAND_FLAG("parameterUnrecognizedCommandFlag", "&cUnrecognized flag: {input}"),
COMMAND_SUBTITLE("commandSubtitle", "&0- &6/bgui &lsubtitle&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<fadeIn> &6<stay> &6<fadeOut> &6<message> &0- &7Send subtitle to players"),
COMMAND_SUDO("commandSudo", "&0- &6/bgui &lsudo&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<command> &0- &7Force players to execute a command");


private static final @NotNull Map<String, String> messages = new HashMap<>();
Expand Down
19 changes: 19 additions & 0 deletions src/main/resources/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
aliases:
- authors
size: 45
title: '&6BungeeGui Authors'
items:
'0,8,36,44':
type: nether_star
'21':
type: player_head
data: owner:DaniFoldi
name: '&9&lDaniFoldi'
lore:
- '&1Plugin developer'
'23':
type: player_head
data: owner:HgeX
name: '&c&lHgeX'
lore:
- '&4Plugin developer'
194 changes: 2 additions & 192 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,192 +1,2 @@
guis:
servermenu:
aliases:
- lobby
- servers
size: 54
title: '&d&lExampleCraft &dserver menu'
items:
'row0,row5,column0,column8':
type: white_stained_glass_pane
'20':
type: player_head
name: '&aEconomy server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQ1ZjQ3ZmViNGQ3NWNiMzMzOTE0YmZkYjk5OWE0ODljOWQwZTMyMGQ1NDhmMzEwNDE5YWQ3MzhkMWUyNGI5In19fQ='
commands:
- server economy
'22':
type: player_head
name: '&bCreative server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODQ0OWI5MzE4ZTMzMTU4ZTY0YTQ2YWIwZGUxMjFjM2Q0MDAwMGUzMzMyYzE1NzQ5MzJiM2M4NDlkOGZhMGRjMiJ9fX0='
commands:
- server creative
'24':
type: player_head
name: '&cKitPvp server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjVhOTNmMTczOTI4MDYwMjZmY2ZiMmRiNzcxOGRhMjQ2Yzg4MTg5NWIzMGVjYjEyODRkODNmOTg3ZWI4In19fQ=='
commands:
- server kitpvp
'30':
type: player_head
name: '&dPrison server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjA5M2U1ZGQwMWQ3NmQ1YzM1NTQ2MTIzMTUwMzE0ZjNlZjNkMWQ5OTMzOWQ0ZmFjNzhjZWYyODM1Y2NlZGVmYSJ9fX0='
commands:
- server prison
'32':
type: player_head
name: '&eSkyblock server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjFiYjJjM2JkNjVjZGQ4NGE4MDRlY2E5OGI3YTQ2NzM1ZjAxZTZhMWM5MTk5ZDY2NjE2NjNkYmRiNGY1YjQifX19'
commands:
- server skyblock
authors:
aliases: [authors]
size: 45
title: '&6BungeeGui Authors'
items:
'0,8,36,44':
type: nether_star
'21':
type: player_head
data: owner:DaniFoldi
name: '&9&lDaniFoldi'
lore:
- '&1Plugin developer'
'23':
type: player_head
data: owner:HgeX
name: '&c&lHgeX'
lore:
- '&4Plugin developer'
stats:
aliases:
- stats
size: 45
title: '&4&lStatistics'
openSound:
sound: block_beacon_activate
volume: 0.4
closeable: false
items:
row0,row4,column0,column8:
type: red_stained_glass_pane
enchanted: true
clickSound:
sound: entity_villager_no
'13':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzI3NDA3NjFkYmQ0MmY3NmU0ZjEyYzQ4ZWMwOTlhY2RjMWM2OTI3MmFiNTc2MzU3OWJiZTkxYzVmNTg2NTZkNyJ9fX0=
name: '%bungeegui%'
lore: [ 'Guis loaded: %guicount%', 'Description: %plugin_description@BungeeGUI%',
'Version: %plugin_version@BungeeGUI%', 'Author: %plugin_author@BungeeGUI%',
'Main class: %plugin_main@BungeeGUI%', 'Depends: %plugin_depends@BungeeGUI%',
'Softdepends: %plugin_softdepends@BungeeGUI%' ]
'21':
type: player_head
data: owner:{player}
name: '%name%'
lore: [ '&4Ping: %ping%', '&5Server: %servername%', '&7Vanished: %vanished%',
'Version: %version%', 'Client locale: %locale%', 'Luckperms group: %luckperms_group%',
'Luckperms name: %luckperms_prefix%%displayname%%luckperms_suffix%' ]
'23':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGQxOWM2ODQ2MTY2NmFhY2Q3NjI4ZTM0YTFlMmFkMzlmZTRmMmJkZTMyZTIzMTk2M2VmM2IzNTUzMyJ9fX0=
name: '%proxyname%'
lore: [ 'Version: %proxyversion%', '&4Memory: %ram_used% / %ram_total% MB',
'&5Players: %online_visible% / %max%', '&6Plugins: %plugincount%', 'Servers:
%servercount%' ]
'31':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjYwYjAwNGYzNjBlMjg4NTVjY2YxMjM1YzJiZGVhMGEyOTk3YjBiYzAzMjU4ZTJkYzI0YWI4YTI1NzBhZWE2In19fQ==
name: '%servername%'
lore: [ 'MOTD: %motd@%servername%%', 'Players: %online_visible@%servername%%
/ %max@%servername%%', 'Version: %version@%servername%%', 'Restricted:
%restricted@%servername%% (Accessible: %canaccess@%servername%%)' ]
'16':
type: barrier
clickSound:
sound: block_beacon_deactivate
volume: 0.4
name: '&cClose'
commands: [ '' ]
sounds:
aliases:
- mobs
- sounds
title: '&5&lTest &d&lSounds'
items:
'row0even,row5odd,column0even,column8even':
type: pink_stained_glass_pane
'row0odd,row5even,column0odd,column8odd':
type: purple_stained_glass_pane
'10':
type: zombie_head
clickSound:
sound: entity.zombie.ambient
'12':
type: creeper_head
clickSound:
sound: entity.creeper.primed
'14':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTcxNTI4NzZiYzNhOTZkZDJhMjI5OTI0NWVkYjNiZWVmNjQ3YzhhNTZhYzg4NTNhNjg3YzNlN2I1ZDhiYiJ9fX0=
clickSound:
sound: entity.puffer_fish.blow_up
'16':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmNhNDQ1NzQ5MjUxYmRkODk4ZmI4M2Y2Njc4NDRlMzhhMWRmZjc5YTE1MjlmNzlhNDI0NDdhMDU5OTMxMGVhNCJ9fX0=
clickSound:
sound: entity.skeleton.ambient
'20':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzEzNWY1ODM4ZTUxNTg1ZTE1OTQyZThmMmYxY2MzNmRhOTYzMDcwZGRkNWJhMzVhZjk1ZWQzN2ViNmMzIn19fQ==
clickSound:
sound: entity.parrot.ambient
'22':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzQwMDk3MjcxYmI2ODBmZTk4MWU4NTllOGJhOTNmZWEyOGI4MTNiMTA0MmJkMjc3ZWEzMzI5YmVjNDkzZWVmMyJ9fX0=
clickSound:
sound: entity.cat.ambient
'24':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmU4OWQ3NDQ3NWIyZmMxYTJiMjE1Y2ZjY2ZkODY1NTkyYjg1ODQzYjkyNjBlZjY3MzA0YzJkYmNjNGJiMCJ9fX0=
clickSound:
sound: entity.wolf.howl
volume: 0.2
'28':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjA3MmQ4Y2I4Mzk1YzJiYzg0NTQ3ZTZhYzliOGVkZWVkNzhjODY1OGMwZWQxYjg4M2M2MjljM2E3ZTkwIn19fQ==
clickSound:
sound: entity.polar_bear.warning
'30':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODk1YWVlYzZiODQyYWRhODY2OWY4NDZkNjViYzQ5NzYyNTk3ODI0YWI5NDRmMjJmNDViZjNiYmI5NDFhYmU2YyJ9fX0=
clickSound:
sound: entity.slime.jump
'32':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2YzN2Q1MjRjM2VlZDE3MWNlMTQ5ODg3ZWExZGVlNGVkMzk5OTA0NzI3ZDUyMTg2NTY4OGVjZTNiYWM3NWUifX19
clickSound:
sound: entity.chicken.ambient
'34':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGJkYTFkZjgwYmZhMzE0ODUzMzhkOTYzMzgzZDhkZTI2ZjA1ZjI5MzRmODc1Njk2ODYyNDU0ZTdjNzBmNDVmNiJ9fX0=
clickSound:
sound: entity.cow.ambient
'38':
type: dragon_head
clickSound:
sound: entity.ender_dragon.ambient
'40':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjVjNGQyNGFmZmRkNDgxMDI2MjAzNjE1MjdkMjE1NmUxOGMyMjNiYWU1MTg5YWM0Mzk4MTU2NDNmM2NmZjlkIn19fQ==
clickSound:
sound: block.shulker_box.open
'42':
type: player_head
data: texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGYwMDg1ODkyNmNkOGNkZjNmMWNmNzFlMjEwY2RlNWRhZjg3MDgzMjA1NDdiZDZkZjU3OTU4NTljNjhkOWIzZiJ9fX0=
clickSound:
sound: entity.panda.worried_ambient

configVersion: 4
debugLevel: all
actions: {}
configVersion: 6
logLevel: all
4 changes: 3 additions & 1 deletion src/main/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ parameterStringRegexError: '&cString {input} does not match pattern {regex}'
parameterMissingFlagValue: '&cMissing flag value: {input}'
parameterMissingFlag: '&cMissing flag: {syntax}'
parameterDuplicateFlag: '&cDuplicate flag: {flag}'
parameterUnrecognizedCommandFlag: '&cUnrecognized flag: {input}'
parameterUnrecognizedCommandFlag: '&cUnrecognized flag: {input}'
commandSubtitle: '&0- &6/bgui &lsubtitle&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<fadeIn> &6<stay> &6<fadeOut> &6<message> &0- &7Send subtitle to players'
commandSudo: '&0- &6/bgui &lsudo&r &7all&f|&7s:&6<server>&f|&7p:&6<player> &6<command> &0- &7Force players to execute a command'
38 changes: 38 additions & 0 deletions src/main/resources/servermenu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
aliases:
- lobby
- servers
size: 54
title: '&d&lExampleCraft &dserver menu'
items:
'row0,row5,column0,column8':
type: white_stained_glass_pane
'20':
type: player_head
name: '&aEconomy server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQ1ZjQ3ZmViNGQ3NWNiMzMzOTE0YmZkYjk5OWE0ODljOWQwZTMyMGQ1NDhmMzEwNDE5YWQ3MzhkMWUyNGI5In19fQ='
commands:
- server economy
'22':
type: player_head
name: '&bCreative server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODQ0OWI5MzE4ZTMzMTU4ZTY0YTQ2YWIwZGUxMjFjM2Q0MDAwMGUzMzMyYzE1NzQ5MzJiM2M4NDlkOGZhMGRjMiJ9fX0='
commands:
- server creative
'24':
type: player_head
name: '&cKitPvp server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjVhOTNmMTczOTI4MDYwMjZmY2ZiMmRiNzcxOGRhMjQ2Yzg4MTg5NWIzMGVjYjEyODRkODNmOTg3ZWI4In19fQ=='
commands:
- server kitpvp
'30':
type: player_head
name: '&dPrison server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjA5M2U1ZGQwMWQ3NmQ1YzM1NTQ2MTIzMTUwMzE0ZjNlZjNkMWQ5OTMzOWQ0ZmFjNzhjZWYyODM1Y2NlZGVmYSJ9fX0='
commands:
- server prison
'32':
type: player_head
name: '&eSkyblock server'
data: 'texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjFiYjJjM2JkNjVjZGQ4NGE4MDRlY2E5OGI3YTQ2NzM1ZjAxZTZhMWM5MTk5ZDY2NjE2NjNkYmRiNGY1YjQifX19'
commands:
- server skyblock
Loading

0 comments on commit cdc3473

Please sign in to comment.