A display holds information and ingredients for Categories to setup for.

<aside> 💡 It is also important to read Categories at the same time!

</aside>

Understanding the Display object

Implementing the Display object

Method 1: Manually implementing Display

Extend Display and override the methods.

Method 2: Use BasicDisplay

Extend BasicDisplay, in the constructor return the list of inputs, outputs and the possible display location.

For example, this is the stonecutting display:

public DefaultStoneCuttingDisplay(StonecutterRecipe recipe) {
	this(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem())),
		Optional.ofNullable(recipe.getId()));
}

public DefaultStoneCuttingDisplay(List<EntryIngredient> inputs, List<EntryIngredient> outputs, Optional<ResourceLocation> location) {
	super(inputs, outputs, location);
}

With BasicDisplay, it is super easy to create a DisplaySerializer.

BasicDisplay.Serializer.ofSimple(DefaultStoneCuttingDisplay::new)

More complex setup for BasicDisplay