Skip to content

Commit

Permalink
Add an optional/configurable prefix to all messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertzui123 committed Jul 31, 2023
1 parent e358827 commit 5c40207
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BedrockClans
main: Wertzui123\BedrockClans\Main
version: "3.9"
version: "3.10"
api: 5.0.0
load: POSTWORLD
author: Wertzui123
Expand Down
2 changes: 1 addition & 1 deletion resources/config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions resources/strings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
prefix: "§l§sBedrock§qClans §r§7>> §r"
command:
clan:
usage: "§cUsage: /clan <subcommand: string>"
Expand Down
4 changes: 2 additions & 2 deletions src/Wertzui123/BedrockClans/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
Expand Down

0 comments on commit 5c40207

Please sign in to comment.