WildStacker icon indicating copy to clipboard operation
WildStacker copied to clipboard

Spawners freezing randomly

Open Rhys00 opened this issue 2 years ago • 64 comments

Minecraft's Version

1.8.8

Plugin's Version

2022.6-b390 (I cant go to latest versions as it bugs out bosses from this report https://github.com/BG-Software-LLC/WildStacker/issues/736)

Describe the bug

Spawners randomly freeze on my server, I'm using SuperiorSkyblock. They only freeze (sometimes) when rejoining / leaving the island. I already tested if it was due to chunk loading but this is not the case. This happens as I have a custom collector plugin, so when you leave the chunk after a while the spawners just freeze randomly.

To Reproduce

Cant really reproduce unless you're on my server.

Additional Information

No response

Rhys00 avatar Feb 13 '23 15:02 Rhys00

Having the same issue!

meStormBits avatar Feb 14 '23 17:02 meStormBits

We are too, maybe instead of closing my issue for being a "duplicate" actually investigate it. https://github.com/BG-Software-LLC/WildStacker/issues/744

Rockin21 avatar Feb 14 '23 23:02 Rockin21

We have the same issue on our server. It helped when we changed our ladders in the config to this:

ladders:
  '1':
    entities: []
    default:
      next-upgrade: coal
      min-spawn-delay: 600
      max-spawn-delay: 700
      nearby-players: 16
      max-nearby-entities: 6

The freezing still happens, but it's less common. I don't know what else there is to do about it. It happens when TPS is at 20 and we have no plugins that would decrease the tickrate on the server.

alek4032 avatar Feb 14 '23 23:02 alek4032

Freezing or ticks are delayed (aka, each tick takes more time than needed)?

OmerBenGera avatar Feb 17 '23 19:02 OmerBenGera

Freezing or ticks are delayed (aka, each tick takes more time than needed)?

The spawners completely freeze, as you can see here https://imgur.com/ay2CWjP

Rhys00 avatar Feb 17 '23 19:02 Rhys00

Run /ws debug while looking at a frozen spawner, do you see any messages in console?

OmerBenGera avatar Feb 17 '23 19:02 OmerBenGera

ws debug

It doesnt print anything in console when I do that looking at a frozen spawner

Rhys00 avatar Feb 17 '23 20:02 Rhys00

This means that the server does not tick the spawner at all, which makes me believe it is not a direct cause of WildStacker Are you able to replicate it on a server with only WS installed?

OmerBenGera avatar Feb 18 '23 07:02 OmerBenGera

This means that the server does not tick the spawner at all, which makes me believe it is not a direct cause of WildStacker Are you able to replicate it on a server with only WS installed?

It doesnt happen with just WildStacker, but that is not the point. Its when the WildStacker API gets used it makes those freeze. As we have custom Chunk Collectors linked with WildStacker and its only when the API is used it makes them freeze.

Rhys00 avatar Feb 18 '23 12:02 Rhys00

This means that the server does not tick the spawner at all, which makes me believe it is not a direct cause of WildStacker Are you able to replicate it on a server with only WS installed?

It doesnt happen with just WildStacker, but that is not the point. Its when the WildStacker API gets used it makes those freeze. As we have custom Chunk Collectors linked with WildStacker and its only when the API is used it makes them freeze.

How is it used that causes it to freeze? Give me code snippet that triggers the bug.

OmerBenGera avatar Feb 19 '23 06:02 OmerBenGera

This means that the server does not tick the spawner at all, which makes me believe it is not a direct cause of WildStacker Are you able to replicate it on a server with only WS installed?

It doesnt happen with just WildStacker, but that is not the point. Its when the WildStacker API gets used it makes those freeze. As we have custom Chunk Collectors linked with WildStacker and its only when the API is used it makes them freeze.

How is it used that causes it to freeze? Give me code snippet that triggers the bug.

Will get back to you ASAP, my dev is currently ill. So soon as they check Ill respond ASAP here.

Rhys00 avatar Feb 21 '23 23:02 Rhys00

Hello, the only piece of WildStacker API I'm using is the following:

` LivingEntity livingEntity = (LivingEntity) event.getEntity(); StackedEntity entity = WildStackerAPI.getStackedEntity(livingEntity);

    Collector collector = plugin().getCollectorManager().getFromChunk(event.getLocation());
    if (collector == null) return;
    if (collector.getType() == CollectorType.INSTANT) {

        plugin().getServer().getScheduler().runTaskAsynchronously(plugin(), () -> {
            List<ItemStack> drops = entity.getDrops(0);
            for (ItemStack drop : drops) {
                if (!WorthManager.get().canPickup(drop.getType())) continue;

                collector.add(drop.getType(), drop.getAmount());
            }
        });
        entity.remove();`

meStormBits avatar Feb 22 '23 12:02 meStormBits

This will not cause any spawner to freeze.

OmerBenGera avatar Feb 24 '23 11:02 OmerBenGera

This will not cause any spawner to freeze.

It does, it only happens when that part of the code is used. If its not used then they dont freeze at all.

Rhys00 avatar Feb 27 '23 21:02 Rhys00

Any update on this? We have tested it with and without the API being in.

Rhys00 avatar Mar 07 '23 22:03 Rhys00

Any update on this? We have tested it with and without the API being in.

Its your code, debug it yourself. Might be because you remove the entity async, idk.

OmerBenGera avatar Mar 10 '23 07:03 OmerBenGera

We have debugged, many times. We tried multiple different things and cannot seem to fix it. Can you possibly checkout the source code and help with this? It would really be appreciated.

Rhys00 avatar Mar 17 '23 23:03 Rhys00

We have debugged, many times. We tried multiple different things and cannot seem to fix it. Can you possibly checkout the source code and help with this? It would really be appreciated.

Comment out parts of the code until it doesn't occur anymore, so you can narrow down to the exact line that causes the issue.

OmerBenGera avatar Mar 18 '23 14:03 OmerBenGera

Is this still relevant?

OmerBenGera avatar Jun 23 '23 08:06 OmerBenGera

I have still encountered this issue multiple times. However, I don't use SuperiorSkyblock I have my own skyblock plugin. We don't use Wildstacker API either. We just have tons of tickets being made of spawners not working randomly (as in entities not spawning) and we fix it by breaking and placing the spawners back...

m3hdd avatar Jun 28 '23 20:06 m3hdd

This means that the server does not tick the spawner at all, which makes me believe it is not a direct cause of WildStacker Are you able to replicate it on a server with only WS installed?

It doesnt happen with just WildStacker, but that is not the point. Its when the WildStacker API gets used it makes those freeze. As we have custom Chunk Collectors linked with WildStacker and its only when the API is used it makes them freeze.

.

OmerBenGera avatar Jun 30 '23 11:06 OmerBenGera

Any news regarding this?

OmerBenGera avatar Sep 15 '23 11:09 OmerBenGera

we have the same issue here but not when only ws i installed , if that can help its hapenning ONLY ON THE CHUNK where a player disconnect and the island get unlaoded for exemple if there is 4 spawners each one on a different chunk only the spawner on the chunk i logged out will not work anymore as explained on that screen image

HamtaBot avatar Sep 24 '23 09:09 HamtaBot

@meStormBits @Rhys00 @Rockin21 do you guys have CMI installed ? after sometesting installing CMI caused the issue to come back , currently i have the issue with only thoses plugins installed image

HamtaBot avatar Sep 24 '23 09:09 HamtaBot

https://github.com/BG-Software-LLC/WildStacker/assets/62488520/60d2e44d-e36a-48df-94a7-1538140e2310

as you can see it only spawns at the chunk outside of the one i disconnected, can replicate the bug constently

HamtaBot avatar Sep 24 '23 09:09 HamtaBot

i dont know if my lasts 3 messages can help @OmerBenGera i'll let them repsond if they all have CMI, if yes we have found the issue if not i'll need to investigate further finding the plugin

HamtaBot avatar Sep 24 '23 09:09 HamtaBot

After some testing I managed to get the bug without cmi so it has something to do with chunk loading as it happen only on chunk unload or load

HamtaBot avatar Sep 24 '23 20:09 HamtaBot

another information , when disconnecting and reconnecting multiple times and the bug appear , all spawners inside the chunk i logged in and out are displaying this image

spawners on other chunks are fine

HamtaBot avatar Sep 28 '23 16:09 HamtaBot

@OmerBenGera i think that can help you this is exactly whats hapenning when the bug occur , as you can see on the video the time on spawner go well until it start going slower and then freeze check the end of video https://www.youtube.com/watch?v=uo__HdLY7qU

HamtaBot avatar Sep 28 '23 16:09 HamtaBot

outsite of the test server , on prod it only says image but i am next to the sapwner

HamtaBot avatar Sep 28 '23 17:09 HamtaBot