slipcor / TreeAssist

https://www.spigotmc.org/resources/treeassist.67436/
GNU General Public License v3.0
34 stars 19 forks source link

Infinite spawning saplings glitch #58

Closed iperrealistico closed 3 years ago

iperrealistico commented 4 years ago

An user reported this: image

It's very very strange! Happens randomly!

slipcor commented 4 years ago

hey I did not even start the "tree spreading" implementation - but it seems active already xD

how about a debug?? :D Nothing I do should ever really COPY anything. even though it looks weird to me that it would even be able to grow on sand.

Do you by any chance have sapling protection on so the plugin tries to grow them... gets the response that this failed, drops a sapling (which I never do really unless someone breaks a LEAF block), this one autoplants, and continues?

I have the strong suspicion that this is caused by some plugin duplicating some event. Can you send me your config files? I need to verify this on a test server. Hit me up on discord, I was planning on making a server for my plugins anyway. I am SLiPCoR#0193

slipcor commented 4 years ago

Man I wish this was a video, so we could see what was going on. I suspect we'd see a saplig popping off of a sapling and then planting. What I KNOW can happen is:

The tall spruce trees have a TON of leaves, right. What if we have a luck factor in there (I use vanilla spawning logic for drops) and then basically every leaf block yields a sapling? They get combined by paper into one sapling STACK but ... well... this sapling stack, as long as the "main stack sapling" randomly is decided to "plant itself" by chance, then all resulting saplings coming out of this one stack do the following:

let's say we start with 32 saplings. they are decided to plant themselves.

one plants itself - it gets reduced by 31 and the stack gets thrown around a bit by the "changing stack" animating of paper - this triggers another "we dropped a sapling" logic - and possibly marks the stack as "we will plant" - however the formerly existing stack of 31 ALREADY existed and might have triggered a planting - so this new itemstack could have a double chance of planting!

this stack plants itself, right next to the other sapling, reduce by 30. and again this stack could do the same, jump around a bit, trigger another replanting check, and so on....

I need to know what is going on there, and to be sure I am not debugging something that would not cause this, I think I need your config files. I will then do extensive debug on what is happening to the saplings, in a similar environment with sand, in case sand is causing it.

Now take into account that it might be that a stack might ALREADY be marked for planting and the reducing of the itemstack

iperrealistico commented 4 years ago

Sent you a request on discord, I am Hosom#3615! Sending you config files there