Hehe - I don’t know - but I guess so.
It’s quite large though - so I’d need to do quite a lot of work documenting everything first.
However, each sub-system is isolated and only connected via an event bus - so there’s very little spaghetti. Each component subscribes to and publishes events… So each sub-system can be encapsulated in terms of the events it listens for, the work it does when it hears events, and the new events it then publishes.
There’s also a scripting system - so scripts can be just dropped on the file system and used to fire events into the event stream to cause things to happen - and then a console that can be used to execute scripts by name. For example, I created a script called storm.groovy which is composed of this:
[java]
EventManager.fire(Events.RAIN_REQUEST, Constants.HEAVY_WEATHER_EFFECT)
[/java]
And then I can open the console and type “/ storm” and the rain, wind, cloud, fog, thunder, lightning and block lighting systems all hear the rain request (because they subscribed to that event) and go to work independently producing their own contributions to a rainy day effect - which is only really apparent when you see everything working together at runtime.
To add, let’s say, mushrooms that only bloom when it rains, you’d add a new Mushrooms.java and it could sign up to listen for the RAIN_REQUEST event to be told when to start adding mushrooms everywhere. Or to upgrade the rain to Rain2.0 (saltier!), you could just dike out the existing Rain.java, and replace it with a new Rain2.java that listens for the same events - and none of the other parts of the system would even notice.
And then finally, the scripts can also listen for events - so if you wanted a world in which lightning strikes caused a spray of particles (and why not, eh), you could add a new script with something like:
[java]
EventManager.register(Events.FORK_LIGHTNING, new Callback(final Vector3f strikeLocation) {
EventManager.fire(Events.PARTICLE_REQUEST, strikeLocation, '#FFFFFF', Constants.SPRAY, Constants.UP)
})
[/java]