From 4914ad0040ad348c4da82b2db4c2aaae97f58fc2 Mon Sep 17 00:00:00 2001 From: Toad-Dev <748280+toad-dev@users.noreply.github.com> Date: Wed, 15 Dec 2021 19:49:35 -0800 Subject: [PATCH] Fix NPE when pistons extend. --- src/main/java/dan200/computercraft/fabric/mixin/MixinLevel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/fabric/mixin/MixinLevel.java b/src/main/java/dan200/computercraft/fabric/mixin/MixinLevel.java index f9132b54e..9ad797626 100644 --- a/src/main/java/dan200/computercraft/fabric/mixin/MixinLevel.java +++ b/src/main/java/dan200/computercraft/fabric/mixin/MixinLevel.java @@ -31,7 +31,7 @@ public class MixinLevel @Inject( method = "setBlockEntity", at = @At( "HEAD" ) ) public void setBlockEntity( @Nullable BlockEntity entity, CallbackInfo info ) { - if( entity != null && !entity.isRemoved() && entity.getLevel().isInWorldBounds( entity.getBlockPos() ) && tickingBlockEntities ) + if( entity != null && !entity.isRemoved() && entity.getLevel() != null && entity.getLevel().isInWorldBounds( entity.getBlockPos() ) && tickingBlockEntities ) { setWorld( entity, this ); }