mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-21 15:59:28 +00:00
Faster floating-point positive modulo
This commit is contained in:
59
patches/server/0125-Ignore-null-legacy-structure-data.patch
Normal file
59
patches/server/0125-Ignore-null-legacy-structure-data.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
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 cc7222cc7e53e8ae693e4e94ad53391db7a663c4..9d1d7033fdd2ae65b8fd323e9199b9d5ea43fe35 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 67c94cd227449b6371a4635a1884d47ec5221997..1cc02389bf53cf4c77145117a68b83505c4a5d6b 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
@@ -52,6 +52,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
public boolean verifyChatOrder = true; // Gale - Pufferfish - make chat order verification configurable
|
||||
public int premiumAccountSlowLoginTimeout = -1; // Gale - make slow login timeout configurable
|
||||
+ public boolean ignoreNullLegacyStructureData = false; // Gale - MultiPaper - ignore null legacy structure data
|
||||
|
||||
public IncludeInTimingsReport includeInTimingsReport;
|
||||
|
||||
Reference in New Issue
Block a user