Skip to content

Commit

Permalink
Add block entity methods in Registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugman76 committed Jan 14, 2023
1 parent d5d708c commit 5361abf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/fr/hugman/dawn/Registrar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,6 +60,10 @@ public static <T extends Entity> void add(Identifier id, EntityType<T> type) {
Registry.register(Registries.ENTITY_TYPE, id, type);
}

public static <T extends BlockEntity> void add(Identifier id, BlockEntityType<T> blockEntity) {
Registry.register(Registries.BLOCK_ENTITY_TYPE, id, blockEntity);
}

public static void add(Identifier id, Feature<?> feature) {
Registry.register(Registries.FEATURE, id, feature);
}
Expand Down Expand Up @@ -147,6 +153,10 @@ public <T extends Entity> void add(String name, EntityType<T> type) {
add(Identifier.of(this.modId, name), type);
}

public <T extends BlockEntity> void add(String name, BlockEntityType<T> blockEntity) {
add(Identifier.of(this.modId, name), blockEntity);
}

public void add(String name, Feature<?> feature) {
add(Identifier.of(this.modId, name), feature);
}
Expand Down

0 comments on commit 5361abf

Please # to comment.