mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
28 lines
1.5 KiB
Diff
28 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Wed, 30 Nov 2022 20:38:15 +0100
|
|
Subject: [PATCH] Prevent entities random strolling into non-ticking chunks
|
|
|
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Don't wander into non-ticking chunks"
|
|
By: PureGero <puregero@gmail.com>
|
|
As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java b/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
|
|
index bad57b0017c78d4d1d32c239fae5bc2ea20bc3c3..28f770d40f5ada6d547e91cd3147969702e1ae75 100644
|
|
--- a/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
|
|
+++ b/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
|
|
@@ -49,7 +49,7 @@ public class RandomStrollGoal extends Goal {
|
|
}
|
|
|
|
Vec3 position = this.getPosition();
|
|
- if (position == null) {
|
|
+ if (position == null || (!this.mob.level().galeConfig().gameplayMechanics.entitiesCanRandomStrollIntoNonTickingChunks && !((net.minecraft.server.level.ServerLevel) this.mob.level()).isPositionEntityTicking(net.minecraft.core.BlockPos.containing(position)))) { // Gale - MultiPaper - prevent entities random strolling into non-ticking chunks
|
|
return false;
|
|
} else {
|
|
this.wantedX = position.x;
|