Skip to content

Commit c359673

Browse files
committed
Fix silo NBT fixer being triggered on normal silos
1 parent 625fe07 commit c359673

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/hlysine/create_connected/mixin/itemsilo/ContraptionMixin.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ private void fixNBT(Level world, CompoundTag nbt, boolean spawnData, CallbackInf
4040
Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo> entry = iterator.next();
4141
if (!(entry.getValue().state().getBlock() instanceof ItemSiloBlock))
4242
continue;
43-
if (!entry.getValue().nbt().contains("Length") && !NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller")).equals(entry.getKey())) {
43+
if (!entry.getValue().nbt().contains("Length") && (
44+
blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller"))) == null ||
45+
!(blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller"))).state().getBlock() instanceof ItemSiloBlock))) {
4446
entry.getValue().nbt().put("Controller", NbtUtils.writeBlockPos(entry.getKey()));
4547
entry.getValue().nbt().putInt("Length", 1);
4648
entry.getValue().nbt().putInt("Size", 1);

0 commit comments

Comments
 (0)