Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6045

Mushroom Blocks ignore cancellation of physics update when redstone is involved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • git-Spigot-9639cf7-8fb6585 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
    • Yes

      Typically, when a mushroom block state updates, it will fire the BlockPhysicsEvent, which can be cancelled. The normal cancelling of this works proper for the BROWN_MUSHROOM_BLOCK, but when you get redstone involved with it, it seems to update it (server-side) even if the event is cancelled.

      The reason this is an issue is because the state of blocks are continuing to be updated even after the event was cancelled if the source of it was redstone.

      For the following explanation, I will be showcasing via videos. Please note that I have implemented textures on different mushroom block states for visual showcasing but these will not be needed to test as there will be console debugs.

       

      As you can see in the video below titled "MushblockWorking", placing down 2 mushroom blocks next to each other AND cancelling the physics update works fine. If I don't cancel it, it wouldn't keep the block states since mushroom blocks will update each other when placed next to each other.

      To prevent spam in this issue, I have attached some console debugs to a paste.

      In this first paste, you will see the physics event fired for the placement of two mushroom blocks next to each other with the physics event being cancelled.

      https://paste.md-5.net/kujayoramu.cs

       

      Now, here is where the problem comes in, which is redstone.

      If you refer to the video attached titled "Redstone Problem", you will see that by just placing down a piece of redstone on a mushroom block, it will update the block states of the blocks around the redstone, even when the physics event is fired AND cancelled, it doesn't actually cancel it properly. You can also see this in the paste linked directly below. The physics event is fired three times. The block at the location of "-112, 67, 213" at first has the "south" state set to true (which this should be maintained). If you look at the last debug set for the paste, it will show the same block with the "south" state set to false. This showing that even with the event cancelled, the block state is still being force updated.

      https://paste.md-5.net/xuhedeniwu.cs

       

      I have also gone ahead and created a demo plugin for this to be tested with. Please keep in mind that you will have to rely on the console output because I added the textures myself for the visual showcase.

        1. MushblockWorking.mp4
          7.32 MB
        2. MushroomTesting.jar
          8 kB
        3. Redstone Problem.mp4
          5.76 MB
        4. Source Code.zip
          61 kB

            Unassigned Unassigned
            Glare Glare M.
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: