9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 14:59:29 +00:00
Files
Gale/gale-server/minecraft-patches/features/0080-Ignore-null-legacy-structure-data.patch
2025-01-27 12:38:00 -05:00

41 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Sun, 25 Dec 2022 23:39:05 +0100
Subject: [PATCH] Ignore null legacy structure data
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:
"Add null check in LegacyStructureDataHandler"
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/level/levelgen/structure/LegacyStructureDataHandler.java b/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
index 28872f70ac27aacc8848cf5659cfd2c55e4cd19a..d928157507dd70645425c51e766783eab17486a0 100644
--- a/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
+++ b/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
@@ -171,13 +171,20 @@ public class LegacyStructureDataHandler {
private void populateCaches(@Nullable DimensionDataStorage storage) {
if (storage != null) {
+ boolean ignoreNullLegacyStructureData = org.galemc.gale.configuration.GaleGlobalConfiguration.get().misc.ignoreNullLegacyStructureData; // Gale - MultiPaper - ignore null legacy structure data
for (String string : this.legacyKeys) {
CompoundTag compoundTag = new CompoundTag();
try {
- compoundTag = storage.readTagFromDisk(string, DataFixTypes.SAVED_DATA_STRUCTURE_FEATURE_INDICES, 1493)
+ // Gale start - MultiPaper - ignore null legacy structure data
+ CompoundTag tag = storage.readTagFromDisk(string, DataFixTypes.SAVED_DATA_STRUCTURE_FEATURE_INDICES, 1493);
+
+ if (ignoreNullLegacyStructureData && tag == null) continue;
+
+ compoundTag = tag
.getCompound("data")
.getCompound("Features");
+ // Gale end - MultiPaper - ignore null legacy structure data
if (compoundTag.isEmpty()) {
continue;
}