9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-24 01:19:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0151-Null-handling-on-MultifaceSpreader.patch
hayanesuru 124dc64a0d update async target finding and block finding (#296)
* reduce overhead on poll

* more async search entities

* async block search

* rename search entity config

* cleanup

* fix async search block too frequent

* remove alertOther Experimental anno

* Adjust the delay of RemoveBlockGoal to match vanilla behavior

* Optimize TemptGoal

* rollback interval change

* cleanup

* add async finding to DefendVillageTargetGoal

* rollback interval change for NearestHealableRaiderTargetGoal

* config searchPlayer

* fix DefendVillageTargetGoal condition doesn't check

* add async finding to BegGoal

* rollback interval change for FollowMobGoal

* cleanup

* add async finding to some follow goal

* add async finding to TemptGoal

* handle searchPlayer config

* fix TemptGoal
2025-04-24 13:18:53 +03:00

27 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Wed, 2 Apr 2025 23:03:22 +0200
Subject: [PATCH] Null handling on MultifaceSpreader
WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
diff --git a/net/minecraft/world/level/block/MultifaceSpreader.java b/net/minecraft/world/level/block/MultifaceSpreader.java
index 60f47334bb855d5216f57f888f131ba41f728d21..718223a54da75d000e3c3090acf6e28b4283820a 100644
--- a/net/minecraft/world/level/block/MultifaceSpreader.java
+++ b/net/minecraft/world/level/block/MultifaceSpreader.java
@@ -148,6 +148,14 @@ public class MultifaceSpreader {
}
default boolean placeBlock(LevelAccessor level, MultifaceSpreader.SpreadPos pos, BlockState state, boolean markForPostprocessing) {
+ // Leaf start - Null handling on MultifaceSpreader
+ // Check for null
+ if (pos.source() == null || pos.pos() == null) {
+ org.dreeam.leaf.config.LeafConfig.LOGGER.warn("Invalid SpreadPos with null source or position: {}", pos);
+ return false;
+ }
+ // Leaf end - Null handling on MultifaceSpreader
+
BlockState stateForPlacement = this.getStateForPlacement(state, level, pos.pos(), pos.face());
if (stateForPlacement != null) {
if (markForPostprocessing) {