Skip to content

Commit

Permalink
Fixed runData crash. Fixes #2615
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Jul 14, 2020
1 parent 93e443b commit 3be3ca9
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ public class ClientSetup {
private final BakedModelOverrideRegistry bakedModelOverrideRegistry = new BakedModelOverrideRegistry();

public ClientSetup() {
IResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
if (resourceManager instanceof IReloadableResourceManager) {
((IReloadableResourceManager) resourceManager).addReloadListener(new ResourcePackListener());
Minecraft minecraft = Minecraft.getInstance();
if (minecraft != null) { // This is null in a runData environment.
IResourceManager resourceManager = minecraft.getResourceManager();
if (resourceManager instanceof IReloadableResourceManager) {
((IReloadableResourceManager) resourceManager).addReloadListener(new ResourcePackListener());
}
}

bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "controller"), (base, registry) -> new FullbrightBakedModel(
Expand Down

0 comments on commit 3be3ca9

Please sign in to comment.