mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-21 15:59:28 +00:00
Simplify development run JVM arguments
This commit is contained in:
71
patches/server/0125-Ignore-null-legacy-structure-data.patch
Normal file
71
patches/server/0125-Ignore-null-legacy-structure-data.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
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/src/main/java/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java b/src/main/java/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
|
||||
index 3b2df0411f9ef85445a53292a65f805a80218979..99126888d4ccae266e55ed3d9ed858fb9ac80727 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/LegacyStructureDataHandler.java
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.storage.DimensionDataStorage;
|
||||
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
|
||||
public class LegacyStructureDataHandler {
|
||||
|
||||
@@ -171,6 +172,7 @@ public class LegacyStructureDataHandler {
|
||||
|
||||
private void populateCaches(@Nullable DimensionDataStorage persistentStateManager) {
|
||||
if (persistentStateManager != null) {
|
||||
+ boolean ignoreNullLegacyStructureData = GaleGlobalConfiguration.get().misc.ignoreNullLegacyStructureData; // Gale - MultiPaper - ignore null legacy structure data
|
||||
Iterator iterator = this.legacyKeys.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -178,7 +180,11 @@ public class LegacyStructureDataHandler {
|
||||
CompoundTag nbttagcompound = new CompoundTag();
|
||||
|
||||
try {
|
||||
- nbttagcompound = persistentStateManager.readTagFromDisk(s, 1493).getCompound("data").getCompound("Features");
|
||||
+ // Gale start - MultiPaper - ignore null legacy structure data
|
||||
+ CompoundTag tag = persistentStateManager.readTagFromDisk(s, 1493);
|
||||
+ if (ignoreNullLegacyStructureData && tag == null) continue;
|
||||
+ nbttagcompound = tag.getCompound("data").getCompound("Features");
|
||||
+ // Gale end - MultiPaper - ignore null legacy structure data
|
||||
if (nbttagcompound.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
index 7dcb82b0784816a84557a3842fe6f5f13ec3d5ff..275bfc7d54d89e10749e14522a790f2878d99c2c 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
@@ -88,6 +88,19 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
||||
public int premiumAccountSlowLoginTimeout = -1;
|
||||
// Gale end - make slow login timeout configurable
|
||||
|
||||
+ // Gale start - MultiPaper - ignore null legacy structure data
|
||||
+ /**
|
||||
+ * Whether to ignore any legacy structure data, for which the NBT tag parser returns null for some reason.
|
||||
+ * If true, no warning will be given when this happens.
|
||||
+ * If false, an exception will be thrown in the console when this happens.
|
||||
+ * <ul>
|
||||
+ * <li><i>Default</i>: false</li>
|
||||
+ * <li><i>Vanilla</i>: false</li>
|
||||
+ * </ul>
|
||||
+ */
|
||||
+ public boolean ignoreNullLegacyStructureData = false;
|
||||
+ // Gale end - MultiPaper - ignore null legacy structure data
|
||||
+
|
||||
public IncludeInTimingsReport includeInTimingsReport;
|
||||
|
||||
public class IncludeInTimingsReport extends ConfigurationPart {
|
||||
Reference in New Issue
Block a user