diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/storage/BlockStateLike.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/storage/BlockStateLike.java index 462f1df7..7a86eecf 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/storage/BlockStateLike.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/storage/BlockStateLike.java @@ -3,6 +3,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import com.nomiceu.nomilabs.NomiLabs; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; @@ -65,7 +66,14 @@ public int getOldId() { } public int getId() { - return rl == null ? -1 : DataFixerHandler.getBlockToIdMap().getOrDefault(rl, 0); + // Return oldId as a fallback, so that if the rl is not registered, we can still let remappers remap it + if (rl == null || !DataFixerHandler.getBlockToIdMap().containsKey(rl)) { + NomiLabs.LOGGER.debug("[Data Fixer] Block at Pos {} has Resource Location {}, which is not registered.", rl, pos); + NomiLabs.LOGGER.debug("[Data Fixer] Most likely, this indicates removed blocks. If the Resource Location is null, report this to Nomi-CEu/Nomi-Labs Devs."); + return oldId; + } + // Still use getOrDefault, just in case + return DataFixerHandler.getBlockToIdMap().getOrDefault(rl, oldId); } public BlockStateLike copy() {