PocketMine-MP
PocketMine-MP copied to clipboard
Dye now can be used to change Sign text color
Introduction
Before this PR, the player cannot change the Sign text color by clicking with Dye.
This PR implements changing the Sign text color by clicking with Dye.
Relevant issues
N/A
Changes
API changes
- Added
SignText::getBaseColor(): returns the base text color of sign - Added
SignText::isGlowingText(): returns whether Sign text has been changed to glow by the Dye
Behavioural changes
- Player now can change Sign text color by clicking sign with Dye
SignChangeEventis now also fired when changing text color or glowing text of sign
Backwards compatibility
N/A
Follow-up
N/A
Tests
https://user-images.githubusercontent.com/32565818/147897958-d1a880c0-e1fc-4ec5-9bac-7ffd874010be.mp4
The text is not the same after rejoining the server.
Before (using white dye)

After

This is implemented completely incorrectly. Don't use the wiki for your source of information.
- The text is not supposed to glow unless using
Glow Ink Sac, which is not currently implemented:
- The glow of text can be removed by using
Ink Sac. - Applying colour codes to the text is unnecessary.
- The usage of NBT is incorrect. Bedrock uses a
SignTextColortag, which is an integer containing an ARGB colour code. This means that the PR is significantly overcomplicated (it's as simple as usingDyeColor->getRgbValue()to store aColorobject, except for black, which should use0,0,0- this makes the game show a white border instead of black).
- There are also sounds that should be played when using dye or ink sacs on signs.
Do any other things need to be fixed/changed?
There are still unresolved review comments.
Changed target to PM5 (next-major)
I've made some modifications to the PR, to handle TextIgnoreLegacyBugResolved properly, tidy up the code and improve some doc comments.