diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java index f5ed911cc..eafcb0f6a 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java @@ -27,6 +27,7 @@ import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.EntityRendererManager; +import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.inventory.container.PlayerContainer; @@ -35,6 +36,7 @@ import net.minecraft.particles.BlockParticleData; import net.minecraft.particles.IParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.LazyValue; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -55,6 +57,7 @@ public class PonderWorld extends SchematicWorld { protected Map originalTileEntities; protected Map blockBreakingProgressions; protected List originalEntities; + private LazyValue asClientWorld = new LazyValue<>(() -> WrappedClientWorld.of(this)); protected PonderWorldParticles particles; private final Map> particleFactories; @@ -218,7 +221,7 @@ public class PonderWorld extends SchematicWorld { double mz) { ResourceLocation key = ForgeRegistries.PARTICLE_TYPES.getKey(data.getType()); IParticleFactory iparticlefactory = (IParticleFactory) particleFactories.get(key); - return iparticlefactory == null ? null : iparticlefactory.makeParticle(data, WrappedClientWorld.of(this), x, y, z, mx, my, mz); + return iparticlefactory == null ? null : iparticlefactory.makeParticle(data, asClientWorld.getValue(), x, y, z, mx, my, mz); } public void addParticle(Particle p) {