Skip to content

Commit

Permalink
Prevent crash when ID of block entity is not found, fixes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Sep 8, 2024
1 parent e115afd commit 1a03ed9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static BlockEntity migrateBlockEntity(LevelChunk chunk, BlockEntity block

private static boolean isCopycatAndNeedingConversion(BlockState state, BlockEntity blockEntity) {
ResourceLocation id = BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(blockEntity.getType());
if (id == null) return false;
ResourceKey<Block> resourceKey = state.getBlock().builtInRegistryHolder().key();
if (id.toString().equalsIgnoreCase("create:copycat")) {
if (resourceKey.location().getNamespace().equalsIgnoreCase(Copycats.MODID)) {
Expand Down

0 comments on commit 1a03ed9

Please sign in to comment.