Open organizatsiya opened 3 years ago
I am not saying that it should not be fixed, but I am just curious... why do you limit bamboo, cactus, and campfires?
I think flowers had the same issue, but not sure if it is fixed.
I limit cactus and sugar cane so as not to have gigantic farms on the server because I want to be able to provide sand at a reduced price to promote concrete constructions
Unfortunately, this is extremely hard to track because events are not fired for these kinds of breakages because the player is not involved with it. Actually it may be impossible to track this. That is why there is a recount command for the player to run. If they think the limits are wrong.
And why not just check that when you place or break one of these blocks there is a block of sand or dirt underneath? if it's true, +1 or -1, if it's false, do nothing
Edit: coarse dirt, mycelium, podzol, farmland, dirt, grass, red sand, sand
It's not that - say that the plant is on a block and something breaks that block, then the whole plant is destroyed. In that case, there is no Bukkit event that is fired. The underlying block can be broken in many ways that are not related to players. So, the addon assume the plant is still there. That's the problem. It will over-count, so that's why the player can ask for a recount if they disagree.
Tasty, that is not entirely correct.
Bukkit will call the event: BlockPhysicsEvent
.
It is not called, only if a block is voided or replaced with a physic update suppression. But in these situations. the plant will still float.
It is never recommended to use this event due to the fact, that it is called 7 times per single block. So any check done with this event should be very, very fast. Otherwise, it will impact the server very hard.
Description Hello, The system for calculating limits is flawed for blocks that grow from several blocks. For example, if you put a cactus, +1 is added to the limit but when it grows by 1 block and you break it, -1 is added to the limit which makes 0 while there is still a block of cactus. On the other hand, if you break the block of sand under the cactus, it drops and yet the limit is still +1. Same for sugar cane and bamboo
For campfires, if you put a campfire, the limit adds +1, if you turn it off and then relight it, the limit adds +1 while it's the same campfire, hence a limit result of +2 for a single campfire.