From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 16 Mar 2020 03:07:02 -0400
Subject: [PATCH] dont load chunks for physics


diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index ad9ccd07cc9f49c9d5b106b9078a4ed2ae8d3413..1814f9fe3a43b7bd06e920066e3500606708e08c 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -868,7 +868,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
     public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER
     public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
         if (!this.isClientSide) {
-            IBlockData iblockdata = this.getType(blockposition);
+            IBlockData iblockdata = this.getTypeIfLoaded(blockposition); // EMC
+            if (iblockdata == null) return; // EMC
 
             try {
                 // CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
index 4f40c6c3397596c81147fae4a6a51bfd517643d2..66ab0911279f8b6e4718c99009e5194bef62e57d 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
@@ -647,7 +647,8 @@ public abstract class BlockBase {
                 EnumDirection enumdirection = aenumdirection[l];
 
                 blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection);
-                IBlockData iblockdata = generatoraccess.getType(blockposition_mutableblockposition);
+                IBlockData iblockdata = generatoraccess.getTypeIfLoaded(blockposition_mutableblockposition); // EMC
+                if (iblockdata == null) continue; // EMC
                 IBlockData iblockdata1 = iblockdata.updateState(enumdirection.opposite(), this.p(), generatoraccess, blockposition_mutableblockposition, blockposition);
 
                 Block.a(iblockdata, iblockdata1, generatoraccess, blockposition_mutableblockposition, i, j);
