From 56d8a5d585a44577863116be2b8bc8be31390933 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Thu, 15 Jul 2021 12:13:38 +0100 Subject: [PATCH] Don't update block states when there is no world Fixes #856 --- .../shared/peripheral/diskdrive/TileDiskDrive.java | 2 +- .../computercraft/shared/peripheral/printer/TilePrinter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index 3f97e224a..4f29f067e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -442,7 +442,7 @@ private synchronized void unmountDisk( IComputerAccess computer ) private void updateBlockState() { - if( remove ) return; + if( remove || level == null ) return; if( !diskStack.isEmpty() ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java index 02d0693c2..cbd00bf33 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java @@ -438,7 +438,7 @@ private void updateBlockState() private void updateBlockState( boolean top, boolean bottom ) { - if( remove ) return; + if( remove || level == null ) return; BlockState state = getBlockState(); if( state.getValue( BlockPrinter.TOP ) == top & state.getValue( BlockPrinter.BOTTOM ) == bottom ) return;