From 5c4020701b64e722bb78451e062ea2e0493d9c4e Mon Sep 17 00:00:00 2001 From: Wertzui123 <46199283+Wertzui123@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:25:47 +0200 Subject: [PATCH] Add an optional/configurable prefix to all messages --- plugin.yml | 2 +- resources/config.yml | 2 +- resources/strings.yml | 1 + src/Wertzui123/BedrockClans/Main.php | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin.yml b/plugin.yml index 9837728..8a80cf4 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: BedrockClans main: Wertzui123\BedrockClans\Main -version: "3.9" +version: "3.10" api: 5.0.0 load: POSTWORLD author: Wertzui123 diff --git a/resources/config.yml b/resources/config.yml index 28ab46d..26b994b 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -1,7 +1,7 @@ --- # BedrockClans | Copyright 2019 - 2023 Wertzui123 # Don't edit this if you don't know what you're doing -config-version: "3.9" +config-version: "3.10" # Regex for valid clan names; see https://regexr.com/ for help clan_name_regex: "/^[a-zA-Z0-9_]{3,16}$/" # Banned clan names diff --git a/resources/strings.yml b/resources/strings.yml index bded183..a1d42f6 100644 --- a/resources/strings.yml +++ b/resources/strings.yml @@ -1,4 +1,5 @@ --- +prefix: "§l§sBedrock§qClans §r§7>> §r" command: clan: usage: "§cUsage: /clan " diff --git a/src/Wertzui123/BedrockClans/Main.php b/src/Wertzui123/BedrockClans/Main.php index d0d18db..00db742 100644 --- a/src/Wertzui123/BedrockClans/Main.php +++ b/src/Wertzui123/BedrockClans/Main.php @@ -29,7 +29,7 @@ class Main extends PluginBase private $withdrawCooldownsFile; private $players = []; - const CONFIG_VERSION = '3.9'; + const CONFIG_VERSION = '3.10'; public function onEnable(): void { @@ -52,7 +52,7 @@ public function onEnable(): void } $this->withdrawCooldownsFile = new Config($this->getDataFolder() . 'withdrawCooldowns.json', Config::JSON); $this->loadClans(); - $this->prefix = (string)$this->getConfig()->get('prefix'); + $this->prefix = $this->getString('prefix'); $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this); if ($this->getServer()->getPluginManager()->getPlugin('ScoreHud') !== null) { $this->getServer()->getPluginManager()->registerEvents(new ScoreHudListener($this), $this);