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

Bonemeal interaction

Open jimmikaelkael opened this issue 9 years ago • 26 comments

This handles the bonemeal interaction with:

  • Carrots and potatoes
  • Cocoa
  • Crops
  • DoublePlants (the flowers only, as expected)
  • Grass
  • Tall grasses (normal and fern)
  • Melon and Pumpkin stems
  • Brown and red mushrooms
  • Saplings (I worked around the bukkit bug with saplings MaterialData)

Progress

  • [x] add tree generation
  • [x] add huge mushroom generation
  • [x] provide a test plugin for BlockGrowEvent and StructureGrowEvent

Test Plugin:

  • jar: https://drive.google.com/file/d/0B0gnjB7PN1h3X0VKRnlOMmozZUU/view?usp=sharing
  • source available here: https://gist.github.com/jimmikaelkael/b7aac6c8c27a8dd2aed5

Edited by turt2live

Related Links:

  • Ticket: #206
  • Ticket: #325
  • Waiting for #492 (or similar)
  • Waiting for #289 (or similar)

jimmikaelkael avatar Oct 14 '14 13:10 jimmikaelkael

@turt2live Ready to get this reviewed. Please note that I merged the content of #434 and closed it.

Some notes for tests:

  • for mushrooms, you can place them on mycel or podzol to avoid the light amount checks
  • melon and pumpkins stem grows, but does not produce a fruit: this is an expected behavior as it's generated on block ticking (#431)
  • growing huge trees (redwood, jungle and dark oak, with 4 saplings) is already handled but there's not yet huge trees generation (#492), so don't be desperate if it eats your 4 saplings but just grow a normal tree in north west corner instead ^^
  • remember that "soft materials" currently drops nothing due to another bug

This PR should be pulled before #431.

jimmikaelkael avatar Oct 30 '14 16:10 jimmikaelkael

Simple conflict in ItemTable, keep both sides. Branch

dequis avatar Nov 06 '14 04:11 dequis

@dequis thanks. Rebased on top of master.

jimmikaelkael avatar Nov 06 '14 12:11 jimmikaelkael

@turt2live this PR should be put on hold until #289 is pulled as it will allow to make use of the bonemeal effect instead of spawning particles directly.

jimmikaelkael avatar Nov 07 '14 08:11 jimmikaelkael

PRHOLD: Waiting for #289 for ease of use

turt2live avatar Nov 07 '14 14:11 turt2live

@turt2live I tought that it could wait for #492 too in order to grow all tree species with bonemeal.

jimmikaelkael avatar Nov 08 '14 12:11 jimmikaelkael

PRHOLD: Waiting for #289 for ease of use and #492 for complete implementation

turt2live avatar Nov 08 '14 16:11 turt2live

Both required PRs got merged!

dequis avatar Nov 12 '14 08:11 dequis

@turt2live Fixed the conflicts, and added the use of the now implemented BONEMEAL_USE effect. Retested tree saplings and it seems to be ok.

jimmikaelkael avatar Nov 12 '14 11:11 jimmikaelkael

@turt2live As @dequis opened my eyes here #539, it seems you can stick it again with "On Hold" label: This PR can wait for #249 to be pulled so that I can change my BlockAttachable extends to BlockNeedsAttached (drop cocoa beans when log was broken, drop seeds when soil with crops is destroyed, etc...).

jimmikaelkael avatar Nov 12 '14 17:11 jimmikaelkael

Instead of locking it into a hold state I'll just let it continue as-is. Whichever PR is pulled first will leave the problem for the other to deal with.

turt2live avatar Nov 12 '14 17:11 turt2live

Okay, no problem.

jimmikaelkael avatar Nov 12 '14 17:11 jimmikaelkael

@jimmikaelkael Only known bug: Using bonemeal on a tall grass block will create a double tall grass block, as expected, but it replaces any block that was directly above it.

turt2live avatar Nov 16 '14 04:11 turt2live

@turt2live I'm sorry I forgot to check the above block when growing tall grass. This is fixed now, thank you.

jimmikaelkael avatar Nov 16 '14 08:11 jimmikaelkael

Finally updated Bamboo. This is building: http://bamboo.gserv.me/browse/GLOW-SRV-PR432-124

gdude2002 avatar Nov 18 '14 11:11 gdude2002

@jimmikaelkael Cocoa fails to work on placement.

21:52:47 [WARNING] Wrong MaterialData for COCOA (BlockCocoa): expected SimpleAttachableMaterialData, got COCOA(3) facing EAST SMALL

turt2live avatar Jan 11 '15 04:01 turt2live

@turt2live I guess it's because of the physics update. I'll check that soon.

jimmikaelkael avatar Jan 11 '15 09:01 jimmikaelkael

@turt2live I've rebased on top of master and fixed bug.

jimmikaelkael avatar Jan 11 '15 15:01 jimmikaelkael

@jimmikaelkael More bugs:

  • Using bonemeal in survival on grass does not spawn a patch like it should
  • Bonemeal can be used in adventure mode (should be restricted)

turt2live avatar Jan 11 '15 21:01 turt2live

@turt2live For the survival bug, I'm unable to reproduce it.

jimmikaelkael avatar Jan 12 '15 06:01 jimmikaelkael

@jimmikaelkael This is the setup I used to test the grass:

asd

The large patch of grass was tested in creative mode just fine (in that state). After a few tests in survival the bonemeal stopped spawning patches and only created 1 grass and sometimes 1 flower instead. Testing again in creative proved to be just fine.

turt2live avatar Jan 17 '15 20:01 turt2live

@turt2live This is because of the "soft material" bug, I guess you're destroying grass in survival mode and try to spawn it on the same place again, is it that ?

jimmikaelkael avatar Jan 17 '15 20:01 jimmikaelkael

@turt2live After a quick test this is confirmed to be the "soft material" bug like I said above. As it is a third party bug I'm sorry but I'll not handle it in this PR (see #541, it is the fix).

Try to break your tall grasses and flowers in survival mode then disconnect the server, and reconnect: you'll see it has been broken on client side ONLY.

This "soft material" bug is quite old and you should consider it for every tests with instabreak blocks when in survival mode.

jimmikaelkael avatar Jan 18 '15 08:01 jimmikaelkael

Whups! I'll test everything else then.

turt2live avatar Jan 18 '15 21:01 turt2live

Assigning to @SpaceManiac as ready to pull with minor formatting concerns.

turt2live avatar Jan 18 '15 22:01 turt2live

@SpaceManiac This pull request is still pending pull. The pull request has been re-tested and is confirmed to be operational.

turt2live avatar Jun 07 '15 01:06 turt2live