Fix for ponder particles yeeting Flywheel rendering.

I need to isolate the world load/unload stuff for
Flywheel anyway, a more robust solution is needed.
This commit is contained in:
JozsefA 2021-03-27 01:10:01 -07:00
parent 56b1170224
commit a7d714f8ba

View file

@ -28,6 +28,7 @@ import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.networking.LeftClickPacket;
import com.simibubi.create.foundation.ponder.PonderTooltipHandler;
import com.simibubi.create.foundation.ponder.PonderWorld;
import com.simibubi.create.foundation.render.KineticRenderer;
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
import com.simibubi.create.foundation.render.backend.RenderWork;
@ -40,6 +41,8 @@ import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollVal
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
import com.simibubi.create.foundation.utility.placement.PlacementHelpers;
import com.simibubi.create.foundation.utility.worldWrappers.WrappedClientWorld;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -131,8 +134,8 @@ public class ClientEvents {
@SubscribeEvent
public static void onLoadWorld(WorldEvent.Load event) {
IWorld world = event.getWorld();
if (world.isRemote() && world instanceof ClientWorld) {
CreateClient.invalidateRenderers();
if (world.isRemote() && world instanceof ClientWorld && !(world instanceof WrappedClientWorld)) {
CreateClient.invalidateRenderers(world);
AnimationTickHolder.reset();
KineticRenderer renderer = CreateClient.kineticRenderer.get(world);
renderer.invalidate();