Closed YellowZaki closed 3 years ago
There are some conflicts that need fixing before merging. Could you look at them?
For the seeds - these are the results of the breaking - so you break growing wheat for example, and the result is WHEAT_SEEDS. Those need to be back-converted to WHEAT. Same with BEETROOT.
I don't understand why fixMaterial is not enough for seeds. Input SEEDS, output WHEAT . When you break the seeds, you remove WHEAT from the db. I this line wheat would be added to db: https://github.com/BentoBoxWorld/Limits/blob/develop/src/main/java/world/bentobox/limits/listeners/BlockLimitsListener.java#L343
The changeTo argument wouldn't be necessary anymore.
I've created a new PR
When players break pistons which are extended or moving, they are not removed from the limit.
In order to resolve this, I had to change fixMaterial(Material) to fixMaterial(Block). Then get the BlockData "TechnicalPiston" in order to know if the PISTON_HEAD/MOVING_PISTON is from NORMAL or STICKY.
Then I realised fixMaterial was being used for others things (https://github.com/BentoBoxWorld/Limits/blob/develop/src/main/java/world/bentobox/limits/listeners/BlockLimitsListener.java#L336) so I couldn't just change the argument from Material to Block, so I set it to Object. Then I cast it to know if it is Block or Material.
I don't really understand why "changeTo" exists. I guess because of this line: https://github.com/BentoBoxWorld/Limits/blob/develop/src/main/java/world/bentobox/limits/listeners/BlockLimitsListener.java#L173 but I don't know how is it possible to break seeds.