From af98782a89a7371a0c963d30d65d0468f1716f88 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Tue, 9 Nov 2021 15:03:52 -0800 Subject: [PATCH] Instance init - So that simi can have his cogs. - Inheritance is painful when models are acquired in an instance's ctor --- .../flywheel/backend/instancing/AbstractInstance.java | 7 +++++++ .../flywheel/backend/instancing/InstanceManager.java | 1 + 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java index b17051c50..7608123d3 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java @@ -29,6 +29,13 @@ public abstract class AbstractInstance implements IInstance, ILightUpdateListene this.world = world; } + /** + * Initialize models here. + */ + public void init() { + + } + /** * Free any acquired resources. */ diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java index 573d3fac2..abfc67bad 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java @@ -286,6 +286,7 @@ public abstract class InstanceManager implements MaterialManagerImpl.OriginSh AbstractInstance renderer = createRaw(obj); if (renderer != null) { + renderer.init(); renderer.updateLight(); LightUpdater.get(renderer.world) .addListener(renderer);