Class EnvironmentManager
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.EnvironmentManager
Controls what instance of the
EnvironmentManager is to be used by Thermoo events-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnvironmentManagerSingleton instance of this class -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends an additional environment controller decorator to the existing environment controller.@NotNull EnvironmentControllerGets the currently configured environment controller.@NotNull EnvironmentControllerPeels off the top decorator of the controller.toString()
-
Field Details
-
INSTANCE
Singleton instance of this class
-
-
Method Details
-
getController
Gets the currently configured environment controller. Note that the controller is reset on server stop/start. By default, the controller is an instance ofEmptyEnvironmentController.- Returns:
- Returns the current environment controller used by Thermoo.
-
addController
Appends an additional environment controller decorator to the existing environment controller.Note that this controller will be removed on server stop, and then reinitialized with
EnvironmentControllerInitializeEvent. It is therefore preferred for mods to add their decorators via that event rather than through direct access to this method.This method is left public primarily for testing/mocking purposes, and should not be used normally.
- Parameters:
decorator- The controller decorator constructor
-
peelController
Peels off the top decorator of the controller. If the controller has no child, then this will do nothing.- Returns:
- Returns the previous decorator
-
toString
-