Slimefun

Slimefun

3M Downloads

Holograms not disappearing again

Skizzles opened this issue · 16 comments

commented

❗ Checklist

  • I am using the official english version of Slimefun and did not modify the jar.
  • I am using an up to date "DEV" (not "RC") version of Slimefun.
  • I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
  • I searched for similar open issues and could not find an existing bug report on this.

📍 Description

If you do not get a response from me, feel free to ping me in the SF discord.

Seems Cargo and other holos are remaining after breaking their linked item again. You can find the same information under #2927

With a possible fix located #3003 which actually had fixed the issue until recently.

📑 Reproduction Steps

Place down a holo based item
Proceed to break the item
Sometimes the holo stays

This is completely random and reproduction steps are still hard to reproduce as last time.

💡 Expected Behavior

For holos to disappear.

📷 Screenshots / Videos

image

📜 Server Log

None shown

📂 /error-reports/ folder

None available

💻 Server Software

Purpur

🎮 Minecraft Version

1.17.x

⭐ Slimefun version

image

🧭 Other plugins

Not applicable to this issue.

commented

similar issue on my server but instead the holograms duplicate when the server restarts
image
image

commented

same issue

saying 'same issue' without information is useless, please add some information to help us to pin point the problem.

commented

same issue

commented

The server restart cause this. Duplicate holograms.
https://www.youtube.com/watch?v=99payQA5brg

[18:33:54 INFO]: This Server uses the following setup of Slimefun:
Paper git-Paper-296 (MC: 1.17.1)
Slimefun DEV - 976 (git fe9d11d)
Metrics-Module #28
Java 16

commented

As Panda pointed out in Discord you can just place and break Energy Regulator and have like 10-20% chance of holograms not disappearing. I'm still finding a better way to replicate this more consistently now.

commented

just as a general note... if it were fixed the issue would be closed and you would see a reference to an edit to the code. Also on the slimefun builds page, when a new build comes out it references the PR and you can click to see the changes.

commented

I found an issue why this is happening.
I debugged some energy regulator's block ticks and found this:

[15:51:59 INFO]: [Slimefun] [STDOUT] block place
[15:51:59 INFO]: [Slimefun] [STDOUT] called from sync update hologram
[15:51:59 INFO]: [Slimefun] [STDOUT] runnable called. diff: 0ms
[15:51:59 INFO]: [Slimefun] [STDOUT] called from async update hologram
[15:51:59 INFO]: [Slimefun] [STDOUT] runnable called. diff: 50ms
[15:52:00 INFO]: [Slimefun] [STDOUT] called from async update hologram
[15:52:00 INFO]: [Slimefun] [STDOUT] runnable called. diff: 50ms
[15:52:00 INFO]: [Slimefun] [STDOUT] called from async update hologram
[15:52:00 INFO]: [Slimefun] [STDOUT] runnable called. diff: 50ms
[15:52:01 INFO]: [Slimefun] [STDOUT] called from async update hologram
[15:52:01 INFO]: [Slimefun] [STDOUT] runnable called. diff: 49ms
[15:52:01 INFO]: [Slimefun] [STDOUT] called from async update hologram <-- start tick, schedule sync task (because tick is async)
[15:52:01 INFO]: [Slimefun] [STDOUT] block break <-- break energy regulator
[15:52:01 INFO]: [Slimefun] [STDOUT] runnable called. diff: 49ms <-- start sync task (update hologram)

This means when block tick schedule sync task, you have 50ms (1 tick) to destroy block and bug a hologram.
Interesting thing is that EnergyRegulator and CargoManager have async BlockTickers.

Code to reproduce hologram bug:

EnergyRegulator

    @Nonnull
    private BlockBreakHandler onBreak() {
        return new SimpleBlockBreakHandler() {

            @Override
            public void onBlockBreak(@Nonnull Block b) {
                System.out.println("block break");
                removeHologram(b);
            }
        };
    }

    @Nonnull
    private BlockPlaceHandler onPlace() {
        return new BlockPlaceHandler(false) {

            @Override
            public void onPlayerPlace(BlockPlaceEvent e) {
                System.out.println("block place");
                updateHologram(e.getBlock(), "&7Connecting...");
            }

        };
    }

HologramService

    private void updateHologram(@Nonnull Location loc, @Nonnull Consumer<Hologram> consumer) {
        Validate.notNull(loc, "Location must not be null");
        Validate.notNull(consumer, "Callbacks must not be null");

        long startTime = System.currentTimeMillis();

        Runnable runnable = () -> {
            try {
                System.out.println("runnable called. diff: "+(System.currentTimeMillis()-startTime)+"ms");
                Hologram hologram = getHologram(loc, true);

                if (hologram != null) {
                    consumer.accept(hologram);
                }
            } catch (Exception | LinkageError x) {
                Slimefun.logger().log(Level.SEVERE, "Hologram located at {0}", new BlockPosition(loc));
                Slimefun.logger().log(Level.SEVERE, "Something went wrong while trying to update this hologram", x);
            }
        };

        if (Bukkit.isPrimaryThread()) {
            System.out.println("called from sync update hologram");
            runnable.run();
        } else {
            System.out.println("called from async update hologram");
            Slimefun.runSync(runnable);
        }
    }

Compiled Jar (build 999): https://drive.google.com/file/d/1Enit3DU29mYrnVt2gqTFZEC2rW_Y0UQz/view

commented

Were you able to find a fix for this yet?

commented

I upload the video to bilibili.com,you can click the url to watch it:
https://www.bilibili.com/video/BV1SL4y1G7oJ/

commented

given all the issues we've seen with blockstorage, I'd bet Alessio's right hand that this may now be tied to it.

commented

Having the same issue. I decided to test a bit, and both myself and some of my other players have found that it isn't just a graphical glitch. Anywhere there is a ghost holo seems to also cause issues with the related network involving that holo. For instance a ghost hologram for a cargo manager will cause issues if is within range of a cargo network, since the game seems to think there is actually still a manager there and thus will not let you use it with a second manager, even though the first isn't actually there. Indicates that something is still see that block as existing even though it doesn't. And we can recreate it so easily that it's actually an issue of trying not to recreate it, frequently taking us 5-10 place/removal to of any block with a hologram to make it go away. Even using a different block that uses holograms, like using an energy regulator to try to remove a ghost cargo manager hologram, will frequently just replace the ghost hologram with one of the block you just placed until you place and remove several times. If requested/needed I can also record video to showcase the issue.

commented

the belief is that the hologram issue is most likely tied to the block storage issue.

commented

as last stated, there's a belief this is a result of blockstorage, which is in the early stages of its rewrite.

commented

I can confirm this is still an issue with latest Dev version of Slimefun

energy regulator would sometimes leave Ghost HD (with power shown or error claiming multiple energy regulators connected)

The only way to remove HD is to break energy regulator, place new energy regulator AND break it while it says "Calculating"

Hopefully this helps

commented

Had Energy Collector placed between Advanced Quarry and Mob Simulation Chamber and Energy Regulator above:

a

commented

But the actual Regulator was bugging when placed near this setup:

1

2