Fix crash with casing loading. Closes #2410

This commit is contained in:
drcrazy 2021-06-19 02:47:14 +03:00
parent 8ab3b3a7be
commit fa2469b034
3 changed files with 3 additions and 8 deletions

View file

@ -255,8 +255,6 @@ public abstract class IMultiblockPart extends BlockEntity {
*/
public abstract void onMultiblockDataAssimilated();
public abstract BlockState getCachedState();
public boolean isInvalid() {
return false;
}

View file

@ -361,9 +361,4 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen
// Clean part out of lists in the registry
MultiblockRegistry.onPartRemovedFromWorld(getWorld(), this);
}
@Override
public BlockState getCachedState() {
return world.getBlockState(pos);
}
}

View file

@ -496,7 +496,9 @@ public class TRContent {
}
public static ItemConvertible[] getCasings() {
return Arrays.stream(MachineBlocks.values()).map((Function<MachineBlocks, ItemConvertible>) machineBlocks -> () -> Item.fromBlock(machineBlocks.casing)).toArray(ItemConvertible[]::new);
return Arrays.stream(MachineBlocks.values())
.map((Function<MachineBlocks, ItemConvertible>) machineBlocks -> () -> machineBlocks.casing.asItem())
.toArray(ItemConvertible[]::new);
}
}