PluginInstance
A class in Root.Township, Alta.Caves.
One cave generation Plugin running for one generator (cave layer). Made by Plugin.GetInstance; holds the plugin's part instances and runs them on each map chunk. Both sides build the rock from the same seed.
- Listed in World generation
- Derived types
RoomFixPluginInstance - Documented in Caves
Constructors
| Member | What it is |
|---|---|
PluginInstance(IGenerator generator, Plugin plugin, bool isEnabled) | Creates a PluginInstance from generator, plugin and isEnabled. |
Fields
1 private and internal field
| Member | What it is |
|---|---|
private IPartInstance[] parts | Per-generator instances of the plugin's parts, passed to Plugin.Modify. |
Properties
| Member | What it is |
|---|---|
IGenerator Generator { get; private set; } | The generator (cave layer) this instance belongs to. |
bool IsEnabled { get; private set; } | Whether it runs. A dynamic plugin is only enabled while the generator is generating dynamic content (on the server, the first time a layer ever generates). |
string Name { get; private set; } | The plugin asset's name, used in logs. |
Plugin Plugin { get; private set; } | The plugin asset. |
int RandomPluginIdentifier { get; private set; } | A random number from the generator's seeded hash and the plugin id, the same on every machine. |
GenerationBase RenderGenerator { get; private set; } | The generator cast to GenerationBase, or null if it isn't one. |
Methods
| Member | What it is |
|---|---|
bool ModifyChunk(MapChunk chunk) | Adds this plugin's layer to the map chunk and runs its parts. Returns false and logs if a part throws. |
IEnumerator RenderChunk(MapChunk chunk) (iterator) | Coroutine that renders the plugin's output for a map chunk, if enabled. |
Used in
Members of other types that take, return or hold a PluginInstance:
GenerationBase.PluginInstances, IGenerator.PluginInstances, MapChunk.AddLayer, MapChunk.Render, MapChunkDisplay.Initialize, MapChunkDisplay.Plugin, MapChunkLayer.MapChunkLayer, MapChunkLayer.Plugin, Plugin.GetInstance, Plugin.Render, ApplyElement.GetInstance, ApplyElementInstance.ApplyElementInstance, BlobEdge.GetInstance, BlobEdgeInstance.BlobEdgeInstance, Blur.GetInstance, BlurInstance.BlurInstance, CellularAutomata.GetInstance, CellularAutomataInstance.CellularAutomataInstance, Circle.GetInstance, CircleInstance.CircleInstance, CopyPart.GetInstance, CopyPartInstance.CopyPartInstance, Curve.GetInstance, CurveInstance.CurveInstance, LogRange.GetInstance, LogRangeInstance.LogRangeInstance, MapGeneratorPart.GetInstance, MapGeneratorPartInstance<T>.MapGeneratorPartInstance<T>, MapGeneratorPartInstance<T>.PluginInstance, Mask.GetInstance, MaskInstance.MaskInstance, OperationPart.GetInstance, OperationPartInstance.OperationPartInstance, RandomNoise.GetInstance, RandomNoiseInstance.RandomNoiseInstance, RoofHole.GetInstance, RoofHoleInstance.RoofHoleInstance, RoomFixes.GetInstance, RoomFixesInstance.RoomFixesInstance, SimplexNoisePart.GetInstance, SimplexNoisePartInstance.SimplexNoisePartInstance, Stretch.GetInstance, StretchInstance.StretchInstance, RoomFixPlugin.GetInstance, RoomFixPlugin.Render.