mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
26 lines
1.6 KiB
Diff
26 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: wangxyper <wangxyper@163.com>
|
|
Date: Fri, 13 Jan 2023 15:22:42 +0800
|
|
Subject: [PATCH] Hearse: Remove a NPE fix
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/NaturalCodeClub/HearseRewrite
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
|
index d6951b05128fea7eb5f1b40837cea77e0c209165..26e1b4060f2a93cb659170f83e6ce64086e0eb0c 100644
|
|
--- a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
|
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
|
@@ -423,10 +423,8 @@ public final class EntityLookup implements LevelEntityGetter<Entity> {
|
|
final ChunkEntitySlices old = this.getChunk(entity.sectionX, entity.sectionZ);
|
|
final ChunkEntitySlices slices = this.getOrCreateChunk(newSectionX, newSectionZ);
|
|
|
|
- if (old!=null){
|
|
- if (!old.removeEntity(entity, entity.sectionY)) {
|
|
- LOGGER.warn("Could not remove entity " + entity + " from its old chunk section (" + entity.sectionX + "," + entity.sectionY + "," + entity.sectionZ + ") since it was not contained in the section");
|
|
- }
|
|
+ if (!old.removeEntity(entity, entity.sectionY)) {
|
|
+ LOGGER.warn("Could not remove entity " + entity + " from its old chunk section (" + entity.sectionX + "," + entity.sectionY + "," + entity.sectionZ + ") since it was not contained in the section");
|
|
}
|
|
|
|
if (!slices.addEntity(entity, newSectionY)) {
|