How to get the world object on "OnOperatingChange" event

Due to human (non-bot) spam the first contribution of a user has to be reviewed and activated manually, all further contributions do not require this.
As long as a user does not have at least one reviewed and activated contribution, the user is unable to edit his profile, set a avatar, title picture or a signature.
  • I'm trying to create a mod which listens to the [ICODE]OnOperatingChange[/ICODE] event triggered by [ICODE]WorldObject[/ICODE] objects.

    Some background information (from my point of understanding, maybe I'm wrong on some of the following points): there are [ICODE]WorldObject[/ICODE]s (like the "Blast Furnace") which act as a crafting table (and thus have the [ICODE]CraftingComponent[/ICODE] interface attached). If the appropriate ingredients were added, a work order may be started, if the other conditions are met: the "Blast Furnace" for example needs fuel (like "Coal"), some room to be placed in which needs to be big enough, etc.

    If any of these prerequisites fail (for example the fuel runs out), there's a [ICODE]OnOperatingChange[/ICODE] event triggered. I'm able to attach/listen to this event like this:

    So this [ICODE]HandleOperatingChange[/ICODE] method is called, I'm seeing that message in the chat window. But how can I get the [ICODE]WorldObject[/ICODE] instance (which triggered this event) in this method? I don't want to iterate over all world objects to see which one may have triggered the [ICODE]OnOperatingChange[/ICODE] event. There has to be a simpler way.

    In the Reacting to player events article in the EcoModKit wiki, we see that the event triggered by a player action has some payload, a [ICODE]CraftAction[/ICODE] which can be used to do things. Is there anything similar for my use case?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!