9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-24 01:09:27 +00:00

Predict Halloween

This commit is contained in:
Martijn Muijsers
2022-12-23 14:08:01 +01:00
parent 642d5e9aff
commit f724183584
18 changed files with 130 additions and 138 deletions

View File

@@ -0,0 +1,87 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 16:29:01 +0100
Subject: [PATCH] Predict Halloween
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index 320c558bbe80d4bbc641e895ec43cfa2b45e8d70..bf62750c31ffba6c2aa4f6d17c1c71c62385e584 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -1,6 +1,6 @@
package net.minecraft.world.entity.ambient;
-import java.time.LocalDate;
+import java.time.OffsetDateTime;
import java.time.temporal.ChronoField;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
@@ -256,12 +256,62 @@ public class Bat extends AmbientCreature {
}
}
+ // Gale start - predict Halloween
+
+ /**
+ * The 1-indexed month of the year that Halloween starts (inclusive).
+ */
+ private static final int halloweenStartMonthOfYear = 10;
+
+ /**
+ * The 1-indexed day of the month that Halloween starts (inclusive).
+ */
+ private static final int halloweenStartDayOfMonth = 20;
+
+ /**
+ * The 1-indexed month of the year that Halloween ends (exclusive).
+ */
+ private static final int halloweenEndMonthOfYear = 11;
+
+ /**
+ * The 1-indexed day of the month that Halloween ends (exclusive).
+ */
+ private static final int halloweenEndDayOfMonth = 4;
+
+ /**
+ * The next start of Halloween, given as milliseconds since the Unix epoch.
+ * Will be 0 while not computed yet.
+ */
+ private static long nextHalloweenStart = 0;
+
+ /**
+ * The next end of Halloween, given as milliseconds since the Unix epoch.
+ * Will be 0 while not computed yet.
+ */
+ private static long nextHalloweenEnd = 0;
+
+ // Gale end - predict Halloween
+
private static boolean isHalloween() {
- LocalDate localdate = LocalDate.now();
- int i = localdate.get(ChronoField.DAY_OF_MONTH);
- int j = localdate.get(ChronoField.MONTH_OF_YEAR);
+ // Gale start - predict Halloween
+ long currentEpochMillis = System.currentTimeMillis();
+ if (currentEpochMillis >= nextHalloweenEnd) {
+ // Update prediction
+
+ OffsetDateTime currentDate = OffsetDateTime.now();
+ int currentMonthOfYear = currentDate.get(ChronoField.MONTH_OF_YEAR);
+ int currentDayOfMonth = currentDate.get(ChronoField.DAY_OF_YEAR);
+
+ OffsetDateTime nextHalloweenStartDate = currentDate.with(ChronoField.MONTH_OF_YEAR, halloweenStartMonthOfYear).with(ChronoField.DAY_OF_MONTH, halloweenStartDayOfMonth);
+ if (currentMonthOfYear > halloweenStartMonthOfYear || (currentMonthOfYear == halloweenStartMonthOfYear && currentDayOfMonth >= halloweenStartDayOfMonth)) {
+ nextHalloweenStartDate = nextHalloweenStartDate.with(ChronoField.YEAR, nextHalloweenStartDate.get(ChronoField.YEAR) + 1);
+ }
- return j == 10 && i >= 20 || j == 11 && i <= 3;
+ nextHalloweenStart = nextHalloweenStartDate.toEpochSecond();
+ nextHalloweenEnd = nextHalloweenStartDate.with(ChronoField.MONTH_OF_YEAR, halloweenEndMonthOfYear).with(ChronoField.DAY_OF_MONTH, halloweenEndDayOfMonth).toEpochSecond();
+ }
+ return currentEpochMillis >= nextHalloweenStart;
+ // Gale end - predict Halloween
}
@Override

View File

@@ -1,100 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 16:29:01 +0100
Subject: [PATCH] Reduce spooky season checks
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:
"Only check for spooky season once an hour"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index 320c558bbe80d4bbc641e895ec43cfa2b45e8d70..c4c048fffd3fb6bcce99cb46c09435b17ed075af 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -28,6 +28,7 @@ import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
public class Bat extends AmbientCreature {
@@ -256,12 +257,25 @@ public class Bat extends AmbientCreature {
}
}
+ // Gale start - Airplane - reduced spooky season checks
+ private static boolean isSpookySeason = false;
+ private static int lastSpookyCheck = -((1 << 30) - 1);
+ // Gale end - Airplane - reduced spooky season checks
private static boolean isHalloween() {
+ // Gale start - Airplane - reduced spooky season checks
+ int checkSpookySeasonInterval = GaleGlobalConfiguration.get().smallOptimizations.reducedIntervals.checkSpookySeason;
+ if (checkSpookySeasonInterval <= 1 || net.minecraft.server.MinecraftServer.currentTick - lastSpookyCheck > checkSpookySeasonInterval) {
+ // Gale end - Airplane - reduced spooky season checks
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);
int j = localdate.get(ChronoField.MONTH_OF_YEAR);
- return j == 10 && i >= 20 || j == 11 && i <= 3;
+ // Gale start - Airplane - reduced spooky season checks
+ isSpookySeason = j == 10 && i >= 20 || j == 11 && i <= 3;
+ lastSpookyCheck = net.minecraft.server.MinecraftServer.currentTick;
+ }
+ return isSpookySeason;
+ // Gale end - Airplane - reduced spooky season checks
}
@Override
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 8f8fd98f96cd390ba43033521982a13044df91cf..af4883f8939d017866a9b057491a8400b11fe009 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -23,7 +23,23 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public SmallOptimizations smallOptimizations;
public class SmallOptimizations extends ConfigurationPart {
- public int dummyValue = 0;
+ public ReducedIntervals reducedIntervals;
+ public class ReducedIntervals extends ConfigurationPart {
+
+ // Gale start - Airplane - reduced spooky season checks
+ /**
+ * The interval at which to check for the spooky season for bats.
+ * Given in ticks.
+ * Any value <= 0 behaves like 1.
+ * <ul>
+ * <li><i>Default</i>: 72000 (1 hour)</li>
+ * <li><i>Vanilla</i>: 1</li>
+ * </ul>
+ */
+ public int checkSpookySeason = 20 * 60 * 60;
+ // Gale end - Airplane - reduced spooky season checks
+
+ }
}

View File

@@ -68,12 +68,12 @@ index 9c3ccbbd657d1605b8fabb6e01c11ff31f39a17e..1d1db89362b78ac34d46cdd71b9ab274
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd); this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index af4883f8939d017866a9b057491a8400b11fe009..9bdbd921acdbfdc8da49ce113d009b58749c1d5d 100644 index 8f8fd98f96cd390ba43033521982a13044df91cf..d46f952e5e425eb90f8c435276bfc4542e85f6a7 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -41,6 +41,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -25,6 +25,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} public int dummyValue = 0;
+ // Gale start - Pufferfish - SIMD support + // Gale start - Pufferfish - SIMD support
+ public Simd simd; + public Simd simd;

View File

@@ -44,10 +44,10 @@ index 72946e324c575ef39f3939225b96b68f724da460..75e2a7d19a7056b73c1524902e44cca0
} }
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 9bdbd921acdbfdc8da49ce113d009b58749c1d5d..d407916de006a68318de63b81773e0dfe0d9c119 100644 index d46f952e5e425eb90f8c435276bfc4542e85f6a7..265f5452128187f282e242c1d373f8295c8a9183 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -51,4 +51,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -35,4 +35,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -29,10 +29,10 @@ index 8fac3c35b04429e66e440895ab82a65497147812..ee3acb578d4f72836eb3a4e8336701b3
final String conversationInput = s; final String conversationInput = s;
this.server.processQueue.add(new Runnable() { this.server.processQueue.add(new Runnable() {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index d407916de006a68318de63b81773e0dfe0d9c119..77a7a73c36ab84f5e889651795f9dd500096ca95 100644 index 265f5452128187f282e242c1d373f8295c8a9183..c7a1ba28fd5e8ddd5cb2428bfd1897e292437dcf 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -56,6 +56,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -40,6 +40,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics

View File

@@ -58,10 +58,10 @@ index a0c19503aabab5378d672a30163d35a5ba05b6c1..5ba0a756d45350dcda3caa5518c9a47a
// CraftBukkit end // CraftBukkit end
} else { } else {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 77a7a73c36ab84f5e889651795f9dd500096ca95..a639a7a199adc4c7f15b6d678ca04c63ecd602cc 100644 index c7a1ba28fd5e8ddd5cb2428bfd1897e292437dcf..90d4580b3fa7857b043957f5f148fea79076b8ca 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -55,6 +55,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -39,6 +39,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public class LogToConsole extends ConfigurationPart { public class LogToConsole extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics

View File

@@ -57,10 +57,10 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..d2bbbb0e73dafd2294838137bfbd16ac
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
hasSetFarWarned = true; hasSetFarWarned = true;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index a639a7a199adc4c7f15b6d678ca04c63ecd602cc..c91ab97a879c74e2d3c1972c76a6dc42e1448113 100644 index 90d4580b3fa7857b043957f5f148fea79076b8ca..1c0e40b7dd121c80465997816aa76b1226b4c0de 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -56,6 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -40,6 +40,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements

View File

@@ -58,10 +58,10 @@ index d13ed3069e944d138442ea440ac3eaf8d44c18d3..c89b8e5ea10a465160504f7364db4741
handler.accept((Recipe) optional.get()); handler.accept((Recipe) optional.get());
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index c91ab97a879c74e2d3c1972c76a6dc42e1448113..efb7e3198ab4f327ec6816af143350460f8bd900 100644 index 1c0e40b7dd121c80465997816aa76b1226b4c0de..3bee9e95b392c32f77e7b23aa17c62c7498e4677 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -41,6 +41,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks

View File

@@ -58,10 +58,10 @@ index 110503062b3043cffa082a1cda6b8d57152869aa..951ca1e25cdcdf6a1ade4090ca397f6d
new Exception().printStackTrace(); new Exception().printStackTrace();
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index efb7e3198ab4f327ec6816af143350460f8bd900..933c81e539e2da1901c9b7abf4f0c616d62f4cd6 100644 index 3bee9e95b392c32f77e7b23aa17c62c7498e4677..9816ad367cb4ec2fad09214743c6063668b3b765 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -42,6 +42,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes

View File

@@ -28,10 +28,10 @@ index c0a80824a0307ea673805015119cc834b268f0dc..d7c6e90ccf3a8ce58e5533c5158ce626
return playerChatMessage; return playerChatMessage;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 933c81e539e2da1901c9b7abf4f0c616d62f4cd6..6547faacb4fcd7457a7cf22d894cf18a8d38e329 100644 index 9816ad367cb4ec2fad09214743c6063668b3b765..008695312228e6605618df6c3abaf6878441cc5e 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -63,6 +63,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -47,6 +47,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public Chat chat; public Chat chat;
public class Chat extends ConfigurationPart { public class Chat extends ConfigurationPart {
public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings

View File

@@ -49,10 +49,10 @@ index 6cc577d17201513af62ce847363ee25a3852a1b5..8a59fade265e586622bcaa2cab277261
boolean flag1 = false; boolean flag1 = false;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 6547faacb4fcd7457a7cf22d894cf18a8d38e329..dbe60db4367270eb8041d39922b6b4eab6b709f7 100644 index 008695312228e6605618df6c3abaf6878441cc5e..a1170d6616d1a11c10ed1b9c68946e0c8943ef6b 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -64,6 +64,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -48,6 +48,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public class Chat extends ConfigurationPart { public class Chat extends ConfigurationPart {
public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings
public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings

View File

@@ -39,7 +39,7 @@ index d2b4654a9095a678bbc9e004af969cf54da0fcab..d797bac97ec1adec7a25a26c8e052e70
}); });
this.rotation = Rotation.valueOf(nbt.getString("rotation")); this.rotation = Rotation.valueOf(nbt.getString("rotation"));
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index dbe60db4367270eb8041d39922b6b4eab6b709f7..9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23 100644 index a1170d6616d1a11c10ed1b9c68946e0c8943ef6b..9e8b9bd7e863fae1fa44f5a5afbdce8d7ffb57b1 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -4,8 +4,12 @@ package org.galemc.gale.configuration; @@ -4,8 +4,12 @@ package org.galemc.gale.configuration;
@@ -55,7 +55,7 @@ index dbe60db4367270eb8041d39922b6b4eab6b709f7..9881f69ff25f1eda31ee1f4667c4fa9a
@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"}) @SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
public class GaleGlobalConfiguration extends ConfigurationPart { public class GaleGlobalConfiguration extends ConfigurationPart {
static final int CURRENT_VERSION = 1; static final int CURRENT_VERSION = 1;
@@ -52,7 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -36,7 +40,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }
public LogToConsole logToConsole; public LogToConsole logToConsole;
@@ -64,7 +64,7 @@ index dbe60db4367270eb8041d39922b6b4eab6b709f7..9881f69ff25f1eda31ee1f4667c4fa9a
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
@@ -67,6 +71,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -51,6 +55,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean notSecureMarker = true; // Gale - do not log Not Secure marker public boolean notSecureMarker = true; // Gale - do not log Not Secure marker
} }

View File

@@ -131,10 +131,10 @@ index b9922b07cb105618390187d98acdf89e728e1f5a..a66d202749f243f6752df5027cb7c82f
+ +
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23..ef0a77ed85bf35f5d388cf28ac5d84e553ad1144 100644 index 9e8b9bd7e863fae1fa44f5a5afbdce8d7ffb57b1..fd2138ff050c36c1223843ec770d7658c09c24d9 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -42,6 +42,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public LogToConsole logToConsole; public LogToConsole logToConsole;
public class LogToConsole extends ConfigurationPart.Post { // Gale - EMC - softly log invalid pool element errors public class LogToConsole extends ConfigurationPart.Post { // Gale - EMC - softly log invalid pool element errors

View File

@@ -109,10 +109,10 @@ index 60e2b951216003ae1861b1ee218e38da107b1760..315c7737f75c426a7e5c091fb340187d
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) { if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime); int i = (int) (Util.getMillis() - this.keepAliveTime);
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index ef0a77ed85bf35f5d388cf28ac5d84e553ad1144..cf56844eb2292ff6add463689ee10b873d2ca664 100644 index fd2138ff050c36c1223843ec770d7658c09c24d9..c2960564ae266dce00f10178c4182f4a5338a161 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -89,4 +89,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -73,4 +73,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index cf56844eb2292ff6add463689ee10b873d2ca664..8fc0095ec5bbb8245a528731741bad87da3bd937 100644 index c2960564ae266dce00f10178c4182f4a5338a161..1225c6197293b04ddb18462d7d2ee0caf7834a76 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -99,6 +99,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -83,6 +83,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -87,13 +87,17 @@ index 6f071601266dff833270bbde9863cc0c4dcfa97d..529df114eb0ca3020bf8c699889b9a54
int i = 29999999; int i = 29999999;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 8fc0095ec5bbb8245a528731741bad87da3bd937..3d0c6e754264fc864485eb01deec63f1b80c7044 100644 index 1225c6197293b04ddb18462d7d2ee0caf7834a76..5b2b861292c638c28a92c894fb0959493e8f7b99 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -43,6 +43,25 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -27,7 +27,29 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public int checkSpookySeason = 20 * 60 * 60; public SmallOptimizations smallOptimizations;
// Gale end - Airplane - reduced spooky season checks public class SmallOptimizations extends ConfigurationPart {
- public int dummyValue = 0;
+ public ReducedIntervals reducedIntervals;
+ public class ReducedIntervals extends ConfigurationPart {
+
+ // Gale start - Hydrinity - increase time statistics in intervals + // Gale start - Hydrinity - increase time statistics in intervals
+ /** + /**
+ * The interval at which to increase the time-related statistics such as total playtime, time since + * The interval at which to increase the time-related statistics such as total playtime, time since
@@ -113,6 +117,7 @@ index 8fc0095ec5bbb8245a528731741bad87da3bd937..3d0c6e754264fc864485eb01deec63f1
+ public int increaseTimeStatistics = 100; + public int increaseTimeStatistics = 100;
+ // Gale end - Hydrinity - increase time statistics in intervals + // Gale end - Hydrinity - increase time statistics in intervals
+ +
} + }
// Gale start - Pufferfish - SIMD support // Gale start - Pufferfish - SIMD support
public Simd simd;

View File

@@ -32,7 +32,7 @@ index f5ed3fa20097bdd43a25c76b38353a23743bc9e5..eed9f125df46b616b7234a2d669971bc
// Attempt to detect vectorization // Attempt to detect vectorization
try { try {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 41013054b6046a17a94d3e181b3ffbc7a3824cd2..c2ad33e5fbce8a16498dde2bfd555012660af969 100644 index 959294ff90db8806b1a114b3a6fe365b317a157b..404a0469cdb8b6b1c37e348e1b8a59f89f7469d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -251,6 +251,8 @@ import org.bukkit.scoreboard.Criteria; @@ -251,6 +251,8 @@ import org.bukkit.scoreboard.Criteria;
@@ -45,10 +45,10 @@ index 41013054b6046a17a94d3e181b3ffbc7a3824cd2..c2ad33e5fbce8a16498dde2bfd555012
import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.error.MarkedYAMLException; import org.yaml.snakeyaml.error.MarkedYAMLException;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 3d0c6e754264fc864485eb01deec63f1b80c7044..30416b4622214ebc71956541af76ed1567e36f73 100644 index 5b2b861292c638c28a92c894fb0959493e8f7b99..23e49bcea2aa7c0625cbee99535094d5a5f7045b 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -83,6 +83,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -70,6 +70,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes
public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization

View File

@@ -1899,7 +1899,7 @@ index 69acbab61a79c24312359a63086f9353d740113f..49ace73d901b6f55545bb21a93d026a0
} }
} catch (Exception ex) { } catch (Exception ex) {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 30416b4622214ebc71956541af76ed1567e36f73..751ddcdc3898dccf5c94ba4044b8398a8f23613e 100644 index 23e49bcea2aa7c0625cbee99535094d5a5f7045b..fccfcb9401b9a1347e71959db8635d2dac22fde2 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -2,11 +2,14 @@ @@ -2,11 +2,14 @@
@@ -1917,7 +1917,7 @@ index 30416b4622214ebc71956541af76ed1567e36f73..751ddcdc3898dccf5c94ba4044b8398a
import java.util.Locale; import java.util.Locale;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -72,6 +75,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -59,6 +62,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }
// Gale end - Pufferfish - SIMD support // Gale end - Pufferfish - SIMD support