Skip to content

Commit

Permalink
fix: deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Jan 12, 2025
1 parent 09a40c5 commit 7a3057a
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ import net.mcbrawls.blueprint.BlueprintMod
import net.mcbrawls.blueprint.block.BlueprintBlocks
import net.minecraft.block.entity.BlockEntity
import net.minecraft.block.entity.BlockEntityType
import net.minecraft.datafixer.TypeReferences
import net.minecraft.registry.Registries
import net.minecraft.registry.Registry
import net.minecraft.util.Identifier
import net.minecraft.util.Util

object BlueprintBlockEntityTypes {
val REGION_ID = register("region_id", FabricBlockEntityTypeBuilder.create(::RegionIdBlockEntity, BlueprintBlocks.POINT_REGION))

private fun <T : BlockEntity> register(id: String, builder: FabricBlockEntityTypeBuilder<T>): BlockEntityType<T> {
val identifier = Identifier.of(BlueprintMod.MOD_ID, id)
val datafixType = Util.getChoiceType(TypeReferences.BLOCK_ENTITY, identifier.toString());
val type = builder.build(datafixType)
val type = builder.build()
PolymerBlockUtils.registerBlockEntity(type)
return Registry.register(Registries.BLOCK_ENTITY_TYPE, identifier, type);
return Registry.register(Registries.BLOCK_ENTITY_TYPE, Identifier.of(BlueprintMod.MOD_ID, id), type);
}
}

0 comments on commit 7a3057a

Please sign in to comment.