AlmuraDev / SGCraft

Stargates mod for Minecraft
https://www.almuramc.com/sgcraft/SGCraft.html
MIT License
31 stars 31 forks source link

Added SGMergeEvent when a Stargate is merged #180

Closed bsixel closed 2 years ago

bsixel commented 3 years ago

Event will trigger when the setMerged method is called for a stargate base. For now, not using this for anything in the base mod itself, but having this will make it easier for other modders to react to a Stargate being created. Doesn't directly address any open issue, but will make addressing several easier in the future.

Implemented by adding a new class extending Forge's base Event, and registering it to the normal Forge event bus. Event exposes:

I've got a working example of using this to do a variety of things (generate address loot, list and teleport to gates) in another project (https://github.com/bsixel/etheralt-pack-utils) but since I was unsure how you'd prefer the loot and data storage be handled, I kept it separate. If that looks reasonable I can move the storage and loot portion to this mod in another PR.