Continuity

Continuity

22M Downloads

[Forge] Crash with tetra item

MoePus opened this issue ยท 2 comments

commented

Tetra may init a UnresolvedItemModel

package se.mickelus.tetra.client.model;

class UnresolvedItemModel$Baked extends SimpleBakedModel {
   private static final Material MISSING_TEXTURE;

   public UnresolvedItemModel$Baked(ItemOverrides itemOverrideList) {
      super(List.of(), Map.of(), false, false, false, UnitTextureAtlasSprite.INSTANCE, ItemTransforms.f_111786_, itemOverrideList, RenderTypeGroup.EMPTY);
   }

   public TextureAtlasSprite m_6160_() {
      return MISSING_TEXTURE.m_119204_();
   }

   public List getRenderTypes(ItemStack itemStack, boolean fabulous) {
      return List.of();
   }

   static {
      MISSING_TEXTURE = new Material(TextureAtlas.f_118259_, MissingTextureAtlasSprite.m_118071_());
   }
}

The problem is, in Forge item wont get rendered if RenderTypes is empty, but with Continuity, the UnresolvedItemModel is wrapped by EmissiveBakedModel which calls emitItemQuads. And culledFaces is inited with Map.of() in UnresolvedItemModel, it will return null when calling getQuads with a direction which leads to crash.

Crash Log: https://mclo.gs/ZzWdP33

commented

Report this to Forgified Fabric API. It does not correctly handle item getRenderTypes and getRenderPasses.