Fix static initializer crash when loading BakedRenderable.

This commit is contained in:
gigaherz committed 2022-02-28 22:03:31 +01:00
1 parent 2f8c3ea738
commit ae62362d49
2 files changed
+27 -6

No files matched your search

@@ -19,10 +19,8 @@
package net.minecraftforge.client.model.renderable;
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@@ -33,6 +31,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraftforge.client.model.data.IModelData;
import java.util.Arrays;
import java.util.Random;
import java.util.function.Function;
@@ -41,10 +40,7 @@ import java.util.function.Function;
*/
public class BakedRenderable implements IRenderable<IModelData>
{
private static final ImmutableList<Direction> MODEL_FACINGS = Util.make(ImmutableList.<Direction>builder(), builder -> {
builder.add(Direction.values());
builder.add((Direction)null);
}).build();
private static final Direction[] MODEL_FACINGS = Arrays.copyOf(Direction.values(), Direction.values().length+1);
/**
* Constructs a BakedRenderable from the given model location.