Block Injection API

Injection utilities related to blocks.

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-block-injection-api:<VERSION>'
}

Block Entity Type Injection

BlockEntityTypeInjection.java
public static void inject(BlockEntityType<?> blockEntityType, Block block);

public static void inject(BlockEntityType<?> blockEntityType, Block... blocks);

The methods above are used to inject a BlockEntityType into a block or group of blocks.

Point of Interest Type Injection

PointOfInterestTypeInjection.java
public static void inject(RegistryKey<PointOfInterestType> poi, BlockState state);

public static void inject(RegistryKey<PointOfInterestType> poi, Block block);

public static void inject(RegistryKey<PointOfInterestType> poi, BlockState... states);

public static void inject(RegistryKey<PointOfInterestType> poi, Block... blocks);

The methods above are used to inject a PointOfInterestType into a block, blockstate, or group of either. Injecting into a block will inject the PointOfInterestType into all of its blockstates.

Block State Property Injection

BlockStatePropertyInjection.java
public static <T extends Comparable<T>> void inject(Property<T> property, Block block);

public static <T extends Comparable<T>> void inject(Property<T> property, Block... blocks);

public static <T extends Comparable<T>> void inject(Property<T> property, @Nullable T defaultValue, Block block);

public static <T extends Comparable<T>> void inject(Property<T> property, @Nullable T defaultValue, Block... blocks);

The methods above are used to inject BlockState Properties into a block, optionally with a defaultValue.

Last updated