Player: remove removeFormat, chat formatting is now unconditionally available

This change was made after exploring turning this into a permission. It occurred to me that this feature is entirely superfluous because it's non-vanilla, can be done by plugins, and is usually considered as a bug. In addition, disabling this behaviour required third party code just for this one thing because it was not able to be managed by a permissions plugin.
Instead, it's better to produce a plugin which implements this behaviour if it's desired, by making use of SignChangeEvent and PlayerChatEvent/PlayerCommandPreprocessEvent.

close #3856, close #2288
This commit is contained in:
Dylan K. Taylor
2020-10-06 14:00:23 +01:00
parent e39d2c4621
commit 78bddac823
2 changed files with 3 additions and 17 deletions

View File

@ -105,9 +105,8 @@ abstract class BaseSign extends Transparent{
if($size > 1000){
throw new \UnexpectedValueException($author->getName() . " tried to write $size bytes of text onto a sign (bigger than max 1000)");
}
$removeFormat = $author->getRemoveFormat();
$ev = new SignChangeEvent($this, $author, new SignText(array_map(function(string $line) use ($removeFormat) : string{
return TextFormat::clean($line, $removeFormat);
$ev = new SignChangeEvent($this, $author, new SignText(array_map(function(string $line) : string{
return TextFormat::clean($line, false);
}, $text->getLines())));
$ev->call();
if(!$ev->isCancelled()){