Fix BER registration accessing dispatcher instance through uninitialized

field
This commit is contained in:
Player 2019-11-26 09:43:00 +01:00 committed by Player
parent a1ff8ff878
commit 7fe423d1a5
3 changed files with 3 additions and 6 deletions
build.gradle
fabric-renderer-registries-v1
build.gradle
src/main/java/net/fabricmc/fabric/mixin/client/renderer/registry

View file

@ -12,7 +12,7 @@ plugins {
def ENV = System.getenv()
class Globals {
static def baseVersion = "0.4.14"
static def baseVersion = "0.4.15"
static def mcVersion = "1.15-pre2"
static def yarnVersion = "+build.1"
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-renderer-registries-v1"
version = getSubprojectVersion(project, "2.0.0")
version = getSubprojectVersion(project, "2.0.1")
dependencies {
compile project(path: ':fabric-api-base', configuration: 'dev')

View file

@ -33,15 +33,12 @@ import net.fabricmc.fabric.impl.client.rendereregistry.v1.BlockEntityRendererReg
@Mixin(BlockEntityRenderDispatcher.class)
public abstract class MixinBlockEntityRenderDispatcher {
@Shadow
@Final
public static BlockEntityRenderDispatcher INSTANCE;
@Shadow
@Final
private Map<BlockEntityType<?>, BlockEntityRenderer<?>> renderers;
@Inject(at = @At("RETURN"), method = "<init>")
private void init(CallbackInfo ci) {
BlockEntityRendererRegistryImpl.setup(((t, function) -> renderers.put(t, function.apply(INSTANCE))));
BlockEntityRendererRegistryImpl.setup(((t, function) -> renderers.put(t, function.apply((BlockEntityRenderDispatcher) (Object) this))));
}
}