Yes but it's probably very expensive because server loops for all players
Hook Question
|
02-03-2014, 07:11 AM
It would be even more expensive to call a hook that many times. Trust me, this is the best way to go.
I was thinking of adding a new hook called "OnBlockGrow" (or something like that). It will be called when for example crops or a cactus grow. Any thoughts?
08-17-2014, 10:24 PM
That might actually be nice,
For future plugins, like auto harvest or something like that. Thanks given by: NiLSPACE
08-18-2014, 06:14 AM
There is a similar hook already, OnBlockSpread, so it makes sense to have a growth hook, too.
You should, however, define very precisely what is and what isn't growth. There are 50 blocks that are "updated" each tick in each active chunk. You don't want to call the hook for each of those.
08-18-2014, 06:20 AM
All I could think of was crops and cactuses. Maybe vines as well, but that is already done on the OnBlockSpread hook.
08-18-2014, 06:30 AM
Nether warts, melon and pumpkin stems, saplings.
08-18-2014, 06:32 AM
I consider nether wart and melon/pumpkin stems as crops. I didn't think of saplings though.
12-04-2014, 04:36 AM
Maybe we should also create different hooks for generating stuff?
OnGeneratingBiomes OnGeneratingShape OnGeneratingComposition OnGeneratingFinishers This way plugins can add tiny things as well like biome filters. It should make a plugin for AntherusCraft's fade-in/out effect allot easier.
12-04-2014, 06:34 PM
I'm afraid a hook won't work too well, because the generators are called from several places. Even the existing OnChunkGenerating doesn't work too great if you want to change only something - it's not called when the Trees finisher is asking for neighbors, so the trees are completely wrong then.
We first need to change the generator that all the generating calls go through a predefined path. Then we could add hooks into that path so that the plugins are called at all times. |
« Next Oldest | Next Newest »
|
Users browsing this thread: 18 Guest(s)