BlockEntityPreprocessor

public interface BlockEntityPreprocessor<T extends BlockEntity>(source)

A block entity preprocessor, which extracts information from a block entity for further processing by filters. This class provides Interaction.data (converts a block entity to an object, where properties of the block entity are stored, which will be processed by filters supporting it).

Each block entity can have one preprocessor registered with InitializerContext.registerPreprocessor.

If a GUI screen is open, the preprocessor of the interacted block entity runs each tick, so process should execute quickly.

The result class of process should override the Object.equals method, because filters will only be evaluated, if the preprocessor returns a different object, because the block entity was changed (for example, moved to a different biome).

Parameters

T

The block entity type the preprocessor accepts

Functions

Link copied to clipboard
public abstract Object process(T blockEntity)

Processes a block entity.