1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 16:47:56 +00:00

Fix NPE when pistons extend.

This commit is contained in:
Toad-Dev
2021-12-15 19:49:35 -08:00
parent 27102e6381
commit 4914ad0040

View File

@@ -31,7 +31,7 @@ public class MixinLevel
@Inject( method = "setBlockEntity", at = @At( "HEAD" ) ) @Inject( method = "setBlockEntity", at = @At( "HEAD" ) )
public void setBlockEntity( @Nullable BlockEntity entity, CallbackInfo info ) 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 ); setWorld( entity, this );
} }