diff --git a/CHANGELOG.md b/CHANGELOG.md index f52545e..b7e1594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -### 21.4.2 +### 21.4.3 -- Pass ResourceKey for creation of new items \ No newline at end of file +- Expose Block Entity creation for common api \ No newline at end of file diff --git a/common/src/main/java/com/unrealdinnerbone/trenzalore/api/registry/Regeneration.java b/common/src/main/java/com/unrealdinnerbone/trenzalore/api/registry/Regeneration.java index e4c3847..a067695 100644 --- a/common/src/main/java/com/unrealdinnerbone/trenzalore/api/registry/Regeneration.java +++ b/common/src/main/java/com/unrealdinnerbone/trenzalore/api/registry/Regeneration.java @@ -14,6 +14,8 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Set; @@ -38,12 +40,26 @@ public static void addItemsToCreateTab(ResourceKey tabResourceK Services.PLATFORM.addItemToCreativeTab(tabResourceKey, item); } + @Deprecated(forRemoval = true) + @ApiStatus.ScheduledForRemoval(inVersion = "22.0.0") public static BlockEntityType createBlockEntityType(BlockEntityType.BlockEntitySupplier creator, Block... validBlocks) { return new BlockEntityType<>(creator, Set.of(validBlocks)); } + public static BlockEntityType createBEType(BESuppler creator, Block... validBlocks) { + return new BlockEntityType<>(creator, Set.of(validBlocks)); + } + public static MenuType createMenuType(BiFunction supplier) { return new MenuType<>(supplier::apply, FeatureFlagSet.of()); } + + public interface BESuppler extends BlockEntityType.BlockEntitySupplier { + + @Override + @NotNull + T create(BlockPos blockPos, BlockState blockState); + } + } diff --git a/gradle.properties b/gradle.properties index a5ffaa5..5a4a9e9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -mod_version=21.4.2 +mod_version=21.4.3 maven_group=com.unrealdinnerbone mod_name=Trenzalore mod_author=UnRealDinnerbone