mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-14 17:43:53 +01:00
Fix crash on resource reload
- Invalidate contraption renderers on context gathering
This commit is contained in:
parent
1e65e3aee6
commit
abf8bc8a4e
3 changed files with 8 additions and 3 deletions
|
@ -16,7 +16,7 @@ cursegradle_version = 1.4.0
|
||||||
|
|
||||||
# dependency versions
|
# dependency versions
|
||||||
registrate_version = 1.0.4
|
registrate_version = 1.0.4
|
||||||
flywheel_version = 1.16-0.0.2.9
|
flywheel_version = 1.16-0.0.2.10
|
||||||
jei_version = 7.7.0.106
|
jei_version = 7.7.0.106
|
||||||
|
|
||||||
# curseforge information
|
# curseforge information
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.backend.Backend;
|
|
||||||
import com.jozufozu.flywheel.core.AtlasStitcher;
|
|
||||||
import com.jozufozu.flywheel.core.PartialModel;
|
import com.jozufozu.flywheel.core.PartialModel;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||||
|
@ -79,6 +77,7 @@ public class CreateClient {
|
||||||
modEventBus.addListener(ClientEvents::loadCompleted);
|
modEventBus.addListener(ClientEvents::loadCompleted);
|
||||||
modEventBus.addListener(CreateContexts::flwInit);
|
modEventBus.addListener(CreateContexts::flwInit);
|
||||||
modEventBus.addListener(AllMaterialSpecs::flwInit);
|
modEventBus.addListener(AllMaterialSpecs::flwInit);
|
||||||
|
modEventBus.addListener(ContraptionRenderDispatcher::invalidateOnGatherContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void clientInit(FMLClientSetupEvent event) {
|
public static void clientInit(FMLClientSetupEvent event) {
|
||||||
|
|
|
@ -13,6 +13,8 @@ import static org.lwjgl.opengl.GL20.glUseProgram;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.event.GatherContextEvent;
|
||||||
|
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -146,6 +148,10 @@ public class ContraptionRenderDispatcher {
|
||||||
invalidateAll();
|
invalidateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void invalidateOnGatherContext(GatherContextEvent e) {
|
||||||
|
invalidateAll();
|
||||||
|
}
|
||||||
|
|
||||||
public static void render(AbstractContraptionEntity entity, Contraption contraption,
|
public static void render(AbstractContraptionEntity entity, Contraption contraption,
|
||||||
ContraptionMatrices matrices, IRenderTypeBuffer buffers) {
|
ContraptionMatrices matrices, IRenderTypeBuffer buffers) {
|
||||||
World world = entity.world;
|
World world = entity.world;
|
||||||
|
|
Loading…
Reference in a new issue