emitItemQuads

void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context)

This method will be called during item rendering to generate both the static anddynamic portions of an item model when the model implements this interface and isVanillaAdapter returns false.

Vanilla item rendering is normally very limited. It ignores lightmaps, vertex colors,and vertex normals. Renderers are expected to implement enhanced features for itemmodels. If a feature is impractical due to performance or other concerns, then therenderer must at least give acceptable visual results without the need for special-case handling in model implementations.

Calls to this method will generally happen on the main client thread but nothingprevents a mod or renderer from calling this method concurrently. Implementationsshould not mutate the ItemStack parameter, and best practice will be to make themethod thread-safe.

Implementing this method does NOT mitigate the need to implement a functional getOverrides method, because this method will be calledon the result of getOverrides. However, thatmethod can simply return the base model because the output from this method willbe used for rendering.

Renderer implementations should also use this method to obtain the quads usedfor item enchantment glint rendering. This means models can put geometric variationlogic here, instead of returning every possible shape from getOverrides as vanilla baked models.

Sources

jvm source
Link copied to clipboard