pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Sign Content does not reload - PM4 #4095

Closed Arthur4848 closed 3 years ago

Arthur4848 commented 3 years ago

Issue description

Steps to reproduce the issue

  1. Make a plugin thats change the sign content in a task
  2. Put it on your server
  3. The sign content does not reload

OS and versions

Plugins

Crashdump, backtrace or other files

dktapps commented 3 years ago

Please provide example code where this doesn't work.

Arthur4848 commented 3 years ago

yes, wait a second ^^

dktapps commented 3 years ago

This isn't a chat forum. Just send it when you have it.

Arthur4848 commented 3 years ago

        new SignText();

        Main::$count++;

        $text = new SignText([
                "Test",
                "§0",
                Main::$count++,
                "§0"
            ]);
        $this->getSign()->setText($text);
    }```

Main::$count is by default 0. Every tick it's one more. But the sign doesn't update. (This code has worked with PM3)
dktapps commented 3 years ago

Your code is wrong. Like all other block property changes, you have to setBlock() to see the result of the change.

Arthur4848 commented 3 years ago

Can you send a small example? i am new in plugin development D:

github-actions[bot] commented 3 years ago

Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on submitting an issue.

Docs | Discord | Forums