32 lines
1.7 KiB
Diff
32 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <wangxyper@163.com>
|
|
Date: Wed, 29 Jan 2025 14:57:20 +0800
|
|
Subject: [PATCH] Skip collision check if the block is not belong to current
|
|
tick region
|
|
|
|
A temporary fix of these issues:
|
|
https://github.com/PaperMC/Folia/issues/311
|
|
|
|
Due to that mojang won't ignore the blocks the entity passed by, and sometimes the old position may not be updated and it points to a block that we don't own it, and it will access it during applyEffectsFromBlocks.So the best way to fix that is to skip the collision check of that block because it was already not owned by us and it's not necessary to check it
|
|
|
|
Related to mojang's bug fix:
|
|
https://bugs.mojang.com/browse/MC-92875
|
|
|
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
index b5a535cbcf592ef210981334128365ff5bc68e92..477b71c94461ab504b3955437d0f7acb312ed33f 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -1676,6 +1676,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
return;
|
|
}
|
|
|
|
+ // Luminol start - Try fixing folia's old position issue
|
|
+ if(!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, blockPos) && me.earthme.luminol.config.modules.fixes.FoliaOldPositionIssueFixConfig.enabled) {
|
|
+ continue;
|
|
+ }
|
|
+ // Luminol end
|
|
+
|
|
BlockState blockState = this.level().getBlockState(blockPos);
|
|
if (!blockState.isAir() && set.add(blockPos.asLong())) {
|
|
try {
|