cortexpe / hrkchat Goto Github PK
View Code? Open in Web Editor NEWHierarchy's Chat Formatter
License: GNU Affero General Public License v3.0
Hierarchy's Chat Formatter
License: GNU Affero General Public License v3.0
It would be a lot better if there was a proper user-friendly and self-explanatory message that is sent.
Or maybe even by set a default value in case it really is non-existent.
Would be nice to have more built-in placeholders like hrk.roleName
Hi,
For many hours I tried to find a solution to make my PurePerms rank appear in the chat, but I can't. I don't know what to do with it and that's why I'm contacting you because I'm just a beginner in php. I hope you understood my question, if you need to specify anything, ask me. If I ask on the wrong page, I apologize in advance.
Code:
(use CortexPE \ HRKChat \ event \ PlaceholderResolveEvent; is more in the other code which if you want I can send too. I wrote the whole code in the GroupJoin plugin, I hope it doesn't matter)
/**
* @param PlaceholderResolveEvent $ev
*
* @priority LOWEST
*/
public function onPlaceholderResolve(PlaceholderResolveEvent $ev, Player $player): void { if($ev->getPlaceholderName() === "PureChat.players.Rank") { $ev->setValue((string)$ev->getUserDataMgr()->getGroup($player)->getName()); } }
HRKChat config.yml:
chatFormat:
1: " &3[&6{{myPlugin.player.latency}}&3]§r §7[Member]§r &7{{hrk.displayName}} {{PurePerms.players.Rank}} &8> &7{{msg}}"
2: " &3[&6{{myPlugin.player.latency}}&3]§r §l§6[§l§4Admin§l§6]§r &7{{hrk.displayName}} {{PurePerms.players.Rank}} &8>
&7{{msg}}"
3: " &3[&6{{myPlugin.player.latency}}&3]§r {{PurePerms.players.Rank}} &7{{hrk.displayName}} test &8> &7{{msg}}"
And this was shown in the console:
[Server] dvodany has joined to server!
[21:06:08] [Server thread/INFO]: The admin dvodany joined the server.
[21:06:10] [Server thread/ERROR]: [HRKChat] Unresolved placeholder 'PurePerms.players.Rank'
[21:06:10] [Server thread/INFO]: [21] [Admin] dvodany NULL > Test
From left to right:
Ping
Rank
Name
PurePerms rank
Message
I am sorry for my bad English.
[17:46:36] [Server thread/CRITICAL]: Error: "Call to undefined method CortexPE\Hierarchy\role\RoleManager::indexLookupTable()" (EXCEPTION) in "plugins/Hierarchy_dev-84.phar/src/CortexPE/Hierarchy/role/RoleManager" at line 189
[17:46:36] [Server thread/DEBUG]: #0 plugins/HRKMigrator_dev-3.phar/src/CortexPE/HRKMigrator/Main(128): CortexPE\Hierarchy\role\RoleManager->createRole(string[6] Eltern)
[17:46:36] [Server thread/DEBUG]: #1 plugins/HRKMigrator_dev-3.phar/src/CortexPE/HRKMigrator/Main(81): CortexPE\HRKMigrator\Main->doMigration()
[17:46:36] [Server thread/DEBUG]: #2 src/pocketmine/scheduler/ClosureTask(61): CortexPE\HRKMigrator\Main->CortexPE\HRKMigrator{closure}(integer 1)
[17:46:36] [Server thread/DEBUG]: #3 src/pocketmine/scheduler/TaskHandler(134): pocketmine\scheduler\ClosureTask->onRun(integer 1)
[17:46:36] [Server thread/DEBUG]: #4 src/pocketmine/scheduler/TaskScheduler(176): pocketmine\scheduler\TaskHandler->run(integer 1)
[17:46:36] [Server thread/DEBUG]: #5 src/pocketmine/plugin/PluginManager(643): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 1)
[17:46:36] [Server thread/DEBUG]: #6 src/pocketmine/Server(2380): pocketmine\plugin\PluginManager->tickSchedulers(integer 1)
[17:46:36] [Server thread/DEBUG]: #7 src/pocketmine/Server(2143): pocketmine\Server->tick()
[17:46:36] [Server thread/DEBUG]: #8 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
[17:46:36] [Server thread/DEBUG]: #9 src/pocketmine/Server(1584): pocketmine\Server->start()
[17:46:36] [Server thread/DEBUG]: #10 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[49] /home/minecraft/multicraft/servers/PE/pocketmine/, string[57] /home/minecraft/multicraft/servers/PE/pocketmine/plugins/)
[17:46:36] [Server thread/DEBUG]: #11 src/pocketmine/PocketMine(296): pocketmine\server()
[17:46:36] [Server thread/DEBUG]: #12 (11): require(string[104] phar:///home/minecraft/multicraft/servers/PE/pocketmine/PocketMine-MP.phar/src/p)
[17:46:36] [Server thread/EMERGENCY]: Ein nicht-behebbarer Fehler ist aufgetreten und der Server stürzte ab. Erstelle einen Crash-Dump...
[17:46:36] [Server thread/EMERGENCY]: Bitte lade die "/home/minecraft/multicraft/servers/PE/pocketmine/crashdumps/Fri_May_8-17.46.36-CEST_2020.log" Datei in das Crash-Archiv hoch und reiche den Link auf der Bug-Reporting Seite ein. Gib so viele Informationen wie möglich.
[17:46:36] [Server thread/EMERGENCY]: Der Crash-Dump wurde automatisch zum Crash-Archiv hinzugefügt. Du kannst ihn unter https://crash.pmmp.io/view/4130609 einsehen, oder du benutzt die ID #4130609
�]0;�[17:46:36] [Server thread/DEBUG]: Disabling all plugins
Hierarchy nowadays allows you to use name
s and role ID
s or roleName.ID
combos to fetch roles.
There is no need to make this thing less user-friendly by sticking to just IDs.
2020-05-09 [11:08:10] [Server thread/INFO]: Enabling HRKChat v1.1.1
2020-05-09 [11:08:10] [Server thread/CRITICAL]: TypeError: "Return value of CortexPE\Hierarchy\Hierarchy::getRoleManager() must be an instance of CortexPE\Hierarchy\role\RoleManager, null returned" (EXCEPTION) in "plugins/Hierarchy-master/src/CortexPE/Hierarchy/Hierarchy" at line 173
Please update this to 4.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.