Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire "persistence growth" event #60

Open
benjajaja opened this issue Aug 26, 2015 · 6 comments
Open

Fire "persistence growth" event #60

benjajaja opened this issue Aug 26, 2015 · 6 comments
Assignees

Comments

@benjajaja
Copy link

Whenever a persistent plant grows on chunk load, fire a PersistenceGrowth event (per chunk). Can be cancelled, if cancelled then RB will not attempt to grow blocks in any way.
The event contains:
Array of plants:

  • Plant type (enum)
  • Number of maturity cycles that have been completed (minimum 1)
  • Coords

To be used by https://github.com/ProgrammerDan/Contraptions/tree/reboot. A contraption may cancel the event and e.g. place drops as items into a container.

@ProgrammerDan You see we have a small problem here with contraptions' markers is that markers define a volume which does not match entire chunks, but RB must handle plant growth on chunk load. It shouldn't fire one event per plant either.

@ProgrammerDan
Copy link

Does anything prevent that list from being modified? Alternatively, allow plant growth to be cancelled per plant.

@benjajaja
Copy link
Author

I don't have a good feeling modifying that list, events should be one-way and cancelled at most.
But on the other hands, it's common to e.g. modify a BreakBlockEvent's drop list...

@ProgrammerDan
Copy link

Can't in good conscience cancel all the growth in a chunk simply because of the presence of a single demarkated area. Whether you or I write something that allows finer grain control, it'll need doing.

@benjajaja
Copy link
Author

So let Contraptions modify the list, and RB read it back later?

@ProgrammerDan
Copy link

That's one option; allow for list removals and RB will only "grow" the plants that remain on the list after the event is fired. Alternatively, whatever element is in the list has a flag -- "cancelled" -- and events can safely set that flag, instructing RB to either grow or ignore a particular plant. That's probably the most "bukkit-like" approach, allowing higher priority plugins to supercede earlier plugins based on Bukkit's event handler ordering.

@benjajaja
Copy link
Author

Ok, that sounds at least tad safer than removing items from the list.

@benjajaja benjajaja self-assigned this Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants