Glowstone-Legacy
Glowstone-Legacy copied to clipboard
Add basic random blocks tick
This PR needs #432 to be pulled first.
Progress
- [x] modify the block coordinates random to use only one nextInt() call
- [x] restrict the chunk tick list to a list of chunks around each player
- [x] improve block growth to match vanilla more closely in BlockCrops, BlockNetherWart & BlockStem (chances, other blocks proximity, etc...)
- [x] provide a test plugin for BlockSpreadEvent, BlockFadeEvent, BlockGrowEvent and StructureGrowEvent.
Test Plugin:
- jar: https://drive.google.com/file/d/0B0gnjB7PN1h3blZuZlgzOGV1X0k/view?usp=sharing
- source available here: https://gist.github.com/jimmikaelkael/e5812bcf4c7b098a6d6a
Edited by turt2live
Related Links:
- Ticket: #40
- Waiting on #432 (or similar)
You're on a roll today, eh?
Passed: http://bamboo.gserv.me/browse/GLOW-SRV-PR431-94
Yeah ^^ I've put this in WIP too as I need to make a few improvements.
More things will come: the title is WIP. Particularly some blocks that needs ticking, since it's about farming I'll need this. EDIT: I know it's in some other PR, but I don't care if I need to solve merge conflicts. EDIT2: @ZephireNZ but, seems you're true it's not really needed in there, as it concerns blocks placement checks.
It should be noted that in general when an existing PR is split into other PRs, the WIP resultant PRs will more than likely have merge conflicts. When the non-WIP PRs get pulled, the WIP PRs can rebase against that and magic happens. At that point, some more can come out of WIP and be pulled and the cycle continues \o/
Yeah, and I'm a rebasaholic :)
And this commit already reveals the limitations of the basic block ticking: I get some lockup on overworld save, it's particularly visible when stopping the server. I can easily understand that ticking grass block on all server loaded chunks with grass spreading everywhere on dirt beaches is a major problem ^^
Without looking at the code it sounds like you're ticking all chunks ever. This PR shouldn't increase or decrease that speed of saving by a significant amount.
Also be careful not to have a giant PR as splitting isn't exactly fun.
I won't add it more. I was just testing and found interesting to see if the problem will disappear by building a proper chunk tick list to do block ticking. It didn't happened with the previous commits.
If needed I'll remove BlockGrass.
On a side note: building an appropriate chunk set for block ticking solved the problemsI had previously when grass was spreading everywhere.
I removed the WIP prefix but this PR should wait for #432 even if it's already functional, as it will allow to see crops growth.
Simple conflict in ItemTable, keep both sides. Branch
Thanks @dequis. I've rebased it.
PRHOLD: Waiting for #432
@jimmikaelkael This pull request is considered unmergeable as of yesterday. Please correct the issue for further review. Thanks.