A fix for BlockEntityRenderer issue

This commit is contained in:
SD 2021-03-29 20:56:03 +05:30
parent d949c867fc
commit 9fb2db1fa7
2 changed files with 10 additions and 6 deletions

View file

@ -3,6 +3,8 @@ package org.dimdev.dimdoors;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
import org.dimdev.dimdoors.client.DetachedRiftBlockEntityRenderer;
import org.dimdev.dimdoors.client.EntranceRiftBlockEntityRenderer;
import org.dimdev.dimdoors.client.ModSkyRendering;
import org.dimdev.dimdoors.entity.ModEntityTypes;
import org.dimdev.dimdoors.entity.MonolithEntity;
@ -16,6 +18,7 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
import net.fabricmc.loader.api.FabricLoader;
@Environment(EnvType.CLIENT)
@ -25,7 +28,9 @@ public class DimensionalDoorsClientInitializer implements ClientModInitializer {
ModEntityTypes.initClient();
ModSkyRendering.initClient();
ModFluids.initClient();
ModBlockEntityTypes.initClient();
// ModBlockEntityTypes.initClient();
BlockEntityRendererRegistry.INSTANCE.register(ModBlockEntityTypes.ENTRANCE_RIFT, ctx -> new EntranceRiftBlockEntityRenderer());
BlockEntityRendererRegistry.INSTANCE.register(ModBlockEntityTypes.DETACHED_RIFT, ctx -> new DetachedRiftBlockEntityRenderer());
ModBlocks.initClient();
ModParticleTypes.initClient();

View file

@ -35,9 +35,8 @@ public class ModBlockEntityTypes {
//just loads the class
}
@Environment(EnvType.CLIENT)
public static void initClient() {
BlockEntityRendererRegistry.INSTANCE.register(ModBlockEntityTypes.ENTRANCE_RIFT, ctx -> new EntranceRiftBlockEntityRenderer());
BlockEntityRendererRegistry.INSTANCE.register(ModBlockEntityTypes.DETACHED_RIFT, ctx -> new DetachedRiftBlockEntityRenderer());
}
// @Environment(EnvType.CLIENT)
// public static void initClient() {
//
// }
}