Glowstone-Legacy icon indicating copy to clipboard operation
Glowstone-Legacy copied to clipboard

Add basic random blocks tick

Open jimmikaelkael opened this issue 9 years ago • 14 comments

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)

jimmikaelkael avatar Oct 14 '14 10:10 jimmikaelkael

You're on a roll today, eh?

Passed: http://bamboo.gserv.me/browse/GLOW-SRV-PR431-94

gdude2002 avatar Oct 14 '14 10:10 gdude2002

Yeah ^^ I've put this in WIP too as I need to make a few improvements.

jimmikaelkael avatar Oct 14 '14 10:10 jimmikaelkael

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.

jimmikaelkael avatar Oct 15 '14 05:10 jimmikaelkael

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/

turt2live avatar Oct 15 '14 13:10 turt2live

Yeah, and I'm a rebasaholic :)

jimmikaelkael avatar Oct 15 '14 13:10 jimmikaelkael

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 ^^

jimmikaelkael avatar Oct 15 '14 19:10 jimmikaelkael

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.

turt2live avatar Oct 15 '14 19:10 turt2live

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.

jimmikaelkael avatar Oct 15 '14 19:10 jimmikaelkael

On a side note: building an appropriate chunk set for block ticking solved the problemsI had previously when grass was spreading everywhere.

jimmikaelkael avatar Oct 30 '14 17:10 jimmikaelkael

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.

jimmikaelkael avatar Nov 01 '14 17:11 jimmikaelkael

Simple conflict in ItemTable, keep both sides. Branch

dequis avatar Nov 06 '14 04:11 dequis

Thanks @dequis. I've rebased it.

jimmikaelkael avatar Nov 06 '14 12:11 jimmikaelkael

PRHOLD: Waiting for #432

turt2live avatar Nov 07 '14 02:11 turt2live

@jimmikaelkael This pull request is considered unmergeable as of yesterday. Please correct the issue for further review. Thanks.

turt2live avatar Feb 17 '15 05:02 turt2live