BG-Software-LLC / SuperiorSkyblock2

Optimized, feature packed Skyblock core.
https://bg-software.com/superiorskyblock/
GNU General Public License v3.0
166 stars 139 forks source link

Minecart with hopper seems to break hopper limit #1846

Closed ArDiDEx closed 1 year ago

ArDiDEx commented 1 year ago

Minecraft's Version

image

Plugin's Version

image (close by two or three commits or on latest build, i dont exactly remember)

Describe the bug

Minecart with hoppers (which are counted as hoppers in BlockChangesListener) seem to break the limit by not counting when placed and not counting when recalculating an island

To Reproduce

Additional Information

No response

ArDiDEx commented 1 year ago

Bug seems to be even more than just "on minecart destroy" but even when chunk unloads due to (from what I think)

https://github.com/BG-Software-LLC/SuperiorSkyblock2/blob/118feaf4cbb4c65df9916d2703d2d38f57297e91/src/main/java/com/bgsoftware/superiorskyblock/listener/EntityTrackingListener.java#L90-L97

OmerBenGera commented 1 year ago

This does not happen for me. First, update to latest dev build, as well as try it on a server that runs Paper. If it still doesn't work, use /is admin debug entity_spawn and /is admin debug entity_despawn and find out why the tracking isnt correct.

ArDiDEx commented 1 year ago

Just tried with a fresh PufferFish 1.19.4 install with ViaVersion and Superiorskyblock2 (last build downloaded on bg-software.com) both untouched and on default settings, still works https://streamable.com/8x6vyd

I also managed to find another weird bug where if i place the hopper against a slab it doesnt count until the next recalc, not sure if its a side effect of having default settings or not https://streamable.com/mqn1sm

Gonna try with Paper instead of Pufferfish now to see if I get different results

EDIT: updated streamable links as they expired due to me uploading them with a guest account

ArDiDEx commented 1 year ago

Just tried with Paper 1.19.4 image Still works

btw, here is a video of the bug happening on chunk unload with a minecart hopper in the chunk https://streamable.com/0orbtd

EDIT: updated streamable link as it expired due to me uploading it with a guest account

OmerBenGera commented 1 year ago

As I asked you before, use /is admin debug entity_spawn and /is admin debug entity_despawn, which will print to console whenever an entity spawns or despawns, and find out what breaks exactly.

ArDiDEx commented 1 year ago

breaking and placing minecart with hoppers:

[13:28:48 INFO]: ArDiDEx issued server command: /is blocks
[13:28:51 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::trackEntity {ArDiDEx} {MINECART_HOPPER} {1}
[13:28:51 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::trackEntity Return {Cannot Track Entity}
[13:28:51 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity {ArDiDEx} {MINECART_HOPPER} {1}
[13:28:51 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity Return {Cannot Untrack Entity}

going back to spawn and coming back:

[13:29:45 INFO]: ArDiDEx issued server command: /is admin spawn
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity {ArDiDEx} {SHEEP} {1}
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity Return {Cannot Untrack Entity}
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity {ArDiDEx} {MINECART_HOPPER} {1}
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity Return {Cannot Untrack Entity}
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::trackEntity {ArDiDEx} {MINECART_HOPPER} {1}
[13:29:45 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::trackEntity Return {Cannot Track Entity}
[13:29:46 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity {ArDiDEx} {MINECART_HOPPER} {1}
[13:29:46 INFO]: [SuperiorSkyblock2] DefaultIslandEntitiesTrackerAlgorithm::untrackEntity Return {Cannot Untrack Entity}

^ last two are called indefinitly until i go back to my island (with a rate of like 1 track and untrack per second)

placing hoppers in an angle to not make them count: (second video of fourth comment) (with block_place and block_break debug on)

does not call block_place, so empty logs
OmerBenGera commented 1 year ago

Check out latest dev build, let me know if it works.

ArDiDEx commented 1 year ago

placing hoppers against slab to not make them count doesnt work anymore 👍

placing and breaking minecart with hoppers doesnt work anymore but is still somewhat broken due to /is recalc not taking minecart (and all entities actually) into account (thus after a recalc the hopper count is only the real placed hoppers, and breaking a minecart afterwards just does -1 to the limit, which is incorrect)

going back to spawn still indefinitly calls the entity_despawn debug every 1 second (and makes the hopper count go to 0 after enough time)

OmerBenGera commented 1 year ago

Making entity recalculate to occur every time /is recalc is called could be really laggy and cause performance issues. However, I'd like you to open a dedicated issue regarding this, so I can look what can be done regarding this.

ArDiDEx commented 1 year ago

Making entity recalculate to occur every time /is recalc is called could be really laggy and cause performance issues. However, I'd like you to open a dedicated issue regarding this, so I can look what can be done regarding this.

i'll open one for the is recalc in a few minutes, do i also need to open a new one for the "going back to spawn..."?

OmerBenGera commented 1 year ago

Making entity recalculate to occur every time /is recalc is called could be really laggy and cause performance issues. However, I'd like you to open a dedicated issue regarding this, so I can look what can be done regarding this.

i'll open one for the is recalc in a few minutes, do i also need to open a new one for the "going back to spawn..."?

Nope, as it works as intended. When you go to spawn, the block is removed (the entity is removed from the world), but when you go back, entities are recalculated.

ArDiDEx commented 1 year ago

Making entity recalculate to occur every time /is recalc is called could be really laggy and cause performance issues. However, I'd like you to open a dedicated issue regarding this, so I can look what can be done regarding this.

i'll open one for the is recalc in a few minutes, do i also need to open a new one for the "going back to spawn..."?

Nope, as it works as intended. When you go to spawn, the block is removed (the entity is removed from the world), but when you go back, entities are recalculated.

I maybe explained it wrong so, here is a vid of it happening: https://streamable.com/kcsj7c what i meant is, every 1 second it calls the DefaultIslandEntitiesTrackerAlgorithm::untrackEntity and removes 1 to the counter until i go back to my island (screen of the logs, i only have 1 minecart hopper and i went back to spawn for a few seconds) image

OmerBenGera commented 1 year ago

Please open an issue regarding this as well.