fix BlockEntityRenderRegistry not understanding how constructors work

This commit is contained in:
asie 2018-12-12 14:53:04 +01:00
parent 9d0f790bfc
commit 51ad71a355
2 changed files with 3 additions and 3 deletions
src/main/java/net/fabricmc/fabric

View file

@ -35,7 +35,7 @@ public class BlockEntityRendererRegistry {
} }
public void initialize(Map<Class<? extends BlockEntity>, BlockEntityRenderer<? extends BlockEntity>> map) { public void initialize(BlockEntityRenderDispatcher instance, Map<Class<? extends BlockEntity>, BlockEntityRenderer<? extends BlockEntity>> map) {
if (renderers != null && renderers != map) { if (renderers != null && renderers != map) {
throw new RuntimeException("Tried to set renderers twice!"); throw new RuntimeException("Tried to set renderers twice!");
} }
@ -46,7 +46,7 @@ public class BlockEntityRendererRegistry {
renderers = map; renderers = map;
for (BlockEntityRenderer renderer : renderersTmp.values()) { for (BlockEntityRenderer renderer : renderersTmp.values()) {
renderer.setRenderManager(BlockEntityRenderDispatcher.INSTANCE); renderer.setRenderManager(instance);
} }
renderers.putAll(renderersTmp); renderers.putAll(renderersTmp);
renderersTmp = null; renderersTmp = null;

View file

@ -35,6 +35,6 @@ public class MixinBlockEntityRenderManager {
@Inject(method = "<init>()V", at = @At("RETURN")) @Inject(method = "<init>()V", at = @At("RETURN"))
public void init(CallbackInfo info) { public void init(CallbackInfo info) {
BlockEntityRendererRegistry.INSTANCE.initialize(renderers); BlockEntityRendererRegistry.INSTANCE.initialize((BlockEntityRenderDispatcher) (Object) this, renderers);
} }
} }