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/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java
index 657885cdaa086293f6b5aa6f3058acd16df0ba35..8724ad342bec7c733b3c825bd62dbfa5c28c06dd 100644
--- a/src/main/java/net/minecraft/server/BlockBase.java
+++ b/src/main/java/net/minecraft/server/BlockBase.java
@@ -593,7 +593,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);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 44f52fb6e3aedeadec4be3979ad1c625643cf9fa..0856d7389f9fec20885ee38bac242fb91834c66c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -805,7 +805,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
