Fix server launch

This commit is contained in:
tterrag 2020-05-14 01:04:52 -04:00
parent c3cdf346f7
commit 702a79684b

View File

@ -24,6 +24,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
public class PalettesRegistrate extends CreateRegistrateBase<PalettesRegistrate> { public class PalettesRegistrate extends CreateRegistrateBase<PalettesRegistrate> {
@ -102,8 +103,11 @@ public class PalettesRegistrate extends CreateRegistrateBase<PalettesRegistrate>
private <T extends Block> NonNullUnaryOperator<BlockBuilder<T, PalettesRegistrate>> connectedTextures( private <T extends Block> NonNullUnaryOperator<BlockBuilder<T, PalettesRegistrate>> connectedTextures(
ConnectedTextureBehaviour behavior) { ConnectedTextureBehaviour behavior) {
return b -> b.onRegister(entry -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> return b -> b.onRegister(entry -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> registerModel(entry, behavior)));
CreateClient.getCustomBlockModels() }
.register(entry.delegate, model -> new CTModel(model, behavior))));
@OnlyIn(Dist.CLIENT)
private void registerModel(Block entry, ConnectedTextureBehaviour behavior) {
CreateClient.getCustomBlockModels().register(entry.delegate, model -> new CTModel(model, behavior));
} }
} }