From 5361abfa99bc22fbf5c0cd27e9c9775ca2170636 Mon Sep 17 00:00:00 2001 From: Hugman Date: Sat, 14 Jan 2023 17:20:42 +0100 Subject: [PATCH] Add block entity methods in Registrar --- src/main/java/fr/hugman/dawn/Registrar.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/fr/hugman/dawn/Registrar.java b/src/main/java/fr/hugman/dawn/Registrar.java index b094010..66a9d91 100644 --- a/src/main/java/fr/hugman/dawn/Registrar.java +++ b/src/main/java/fr/hugman/dawn/Registrar.java @@ -10,6 +10,8 @@ import fr.hugman.dawn.shape.ShapeType; import fr.hugman.dawn.shape.processor.ShapeProcessorType; import net.minecraft.block.Block; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.BlockEntityType; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.item.Item; @@ -58,6 +60,10 @@ public static void add(Identifier id, EntityType type) { Registry.register(Registries.ENTITY_TYPE, id, type); } + public static void add(Identifier id, BlockEntityType blockEntity) { + Registry.register(Registries.BLOCK_ENTITY_TYPE, id, blockEntity); + } + public static void add(Identifier id, Feature feature) { Registry.register(Registries.FEATURE, id, feature); } @@ -147,6 +153,10 @@ public void add(String name, EntityType type) { add(Identifier.of(this.modId, name), type); } + public void add(String name, BlockEntityType blockEntity) { + add(Identifier.of(this.modId, name), blockEntity); + } + public void add(String name, Feature feature) { add(Identifier.of(this.modId, name), feature); }