Interface FabricBlockModelPart


@Experimental public interface FabricBlockModelPart
Note: This interface is automatically implemented on all block model parts via Mixin and interface injection.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    emitQuads(QuadEmitter emitter, Predicate<@Nullable Direction> cullTest)
    Produces this model part's geometry.
  • Method Details

    • emitQuads

      default void emitQuads(QuadEmitter emitter, Predicate<@Nullable Direction> cullTest)
      Produces this model part's geometry. This method must be called instead of BlockModelPart.getQuads(Direction); the vanilla method should be considered deprecated as it may not produce accurate results. However, it is acceptable for a custom model part to only implement the vanilla method as the default implementation of this method will delegate to the vanilla method.

      This method mainly exists for convenience when interacting with parts implemented and produced by vanilla code. Custom models should generally override FabricBlockStateModel.emitQuads(QuadEmitter, BlockRenderView, BlockPos, BlockState, Random, Predicate) instead of subclassing BlockModelPart and overriding this method.

      Parameters:
      emitter - Accepts model part output.
      cullTest - A test that returns true for faces which will be culled and false for faces which may or may not be culled. Meant to be used to cull groups of quads or expensive dynamic quads early for performance. Early culled quads will likely not be added the emitter, so callers of this method must account for this. Since model parts should be completely static, this test should be used whenever possible.