mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-02 17:01:38 +01:00
dadd8b5a7c
I cannot test this due to lack of hardware (took 30 minutes getting paper updated and loaded into IJ on this machine...), however, this is the easiest patch for now. Ideally, some form of distance check would probably be added to improve invalidation of this cache.
20 lines
1.0 KiB
Diff
20 lines
1.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Wed, 5 Jul 2023 23:11:53 +0100
|
|
Subject: [PATCH] Don't load chunks for supporting block checks
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 3ffb92a82e17af467afb18c81accc482a93d6a6f..305b43071aa1cf8feee75fae757bb7734ae33771 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -1369,7 +1369,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
}
|
|
|
|
protected BlockPos getOnPos(float offset) {
|
|
- if (this.mainSupportingBlockPos.isPresent()) {
|
|
+ if (this.mainSupportingBlockPos.isPresent() && this.level().getChunkIfLoadedImmediately(this.mainSupportingBlockPos.get()) != null) { // Paper - ensure no loads
|
|
BlockPos blockposition = (BlockPos) this.mainSupportingBlockPos.get();
|
|
|
|
if (offset <= 1.0E-5F) {
|