From 702a79684b53d956659ceda0133e1458c34af65e Mon Sep 17 00:00:00 2001 From: tterrag Date: Thu, 14 May 2020 01:04:52 -0400 Subject: [PATCH] Fix server launch --- .../create/modules/palettes/PalettesRegistrate.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/palettes/PalettesRegistrate.java b/src/main/java/com/simibubi/create/modules/palettes/PalettesRegistrate.java index 9f3eaafe3..d0ae1daee 100644 --- a/src/main/java/com/simibubi/create/modules/palettes/PalettesRegistrate.java +++ b/src/main/java/com/simibubi/create/modules/palettes/PalettesRegistrate.java @@ -24,6 +24,7 @@ import net.minecraft.block.Blocks; import net.minecraft.client.renderer.RenderType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.DistExecutor; public class PalettesRegistrate extends CreateRegistrateBase { @@ -102,8 +103,11 @@ public class PalettesRegistrate extends CreateRegistrateBase private NonNullUnaryOperator> connectedTextures( ConnectedTextureBehaviour behavior) { - return b -> b.onRegister(entry -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> - CreateClient.getCustomBlockModels() - .register(entry.delegate, model -> new CTModel(model, behavior)))); + return b -> b.onRegister(entry -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> registerModel(entry, behavior))); + } + + @OnlyIn(Dist.CLIENT) + private void registerModel(Block entry, ConnectedTextureBehaviour behavior) { + CreateClient.getCustomBlockModels().register(entry.delegate, model -> new CTModel(model, behavior)); } }