9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2026-01-04 15:31:45 +00:00
* Cleanup imports

* Change lithium package name `me.jellysquid` -> `net.caffeinemc`
This commit is contained in:
Dreeam
2024-11-10 12:14:35 -05:00
parent 7ac2d0eaa1
commit 1e0ebadd8e
29 changed files with 138 additions and 324 deletions

View File

@@ -110,19 +110,10 @@ index 0000000000000000000000000000000000000000..00b16e4aacba50996b81fac81c3f78b6
+
+}
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9eec0c781eeaa543a568f1ea490749199593cfec 100644
index c80faa079eca1564847070f0338fc98024639829..8a12bac4f9b0c5798ea1bd7d7aa10ad5d7ced579 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -5,6 +5,8 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
+
+import gg.pufferfish.pufferfish.simd.SIMDDetection;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -40,7 +42,7 @@ public final class MapPalette {
@@ -40,7 +40,7 @@ public final class MapPalette {
}
@NotNull
@@ -131,11 +122,11 @@ index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9eec0c781eeaa543a568f1ea49074919
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
@@ -211,9 +213,15 @@ public final class MapPalette {
@@ -211,9 +211,15 @@ public final class MapPalette {
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
+ if ((mapColorCache != null && mapColorCache.isCached()) || !SIMDDetection.isEnabled()) { // Gale - Pufferfish - vectorized map color conversion
+ if ((mapColorCache != null && mapColorCache.isCached()) || !gg.pufferfish.pufferfish.simd.SIMDDetection.isEnabled()) { // Gale - Pufferfish - vectorized map color conversion
for (int i = 0; i < pixels.length; i++) {
result[i] = matchColor(new Color(pixels[i], true));
}

View File

@@ -268,47 +268,17 @@ index adb8c4f3ed3cb22b62a4b4eb867b197b10cfac54..badd1433e27e2e95b165618de280cba1
+}
+// Gale end - package license into jar
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6fca13221ef3e0bbcad2ebbe74d6aadf8ed2c539 100644
index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..07317899d4e28b55592c8035686c81ea198c1675 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -1,6 +1,5 @@
package com.destroystokyo.paper;
-import com.destroystokyo.paper.util.VersionFetcher;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;
import com.google.gson.Gson;
@@ -8,80 +7,37 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
-import com.mojang.logging.LogUtils;
import io.papermc.paper.ServerBuildInfo;
import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
import java.net.URI;
-import java.util.Optional;
-import java.util.OptionalInt;
import java.util.stream.StreamSupport;
-import net.kyori.adventure.text.Component;
-import net.kyori.adventure.text.event.ClickEvent;
-import net.kyori.adventure.text.format.NamedTextColor;
-import net.kyori.adventure.text.format.TextDecoration;
import org.checkerframework.checker.nullness.qual.NonNull;
-import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
-import org.slf4j.Logger;
-
-import static net.kyori.adventure.text.Component.text;
-import static net.kyori.adventure.text.format.TextColor.color;
+import org.galemc.gale.version.AbstractPaperVersionFetcher;
@@ -30,58 +30,28 @@ import org.slf4j.Logger;
import static net.kyori.adventure.text.Component.text;
import static net.kyori.adventure.text.format.TextColor.color;
+// Gale start - branding changes - version fetcher
+/**
+ * The original version fetcher for Paper. Most of the original content of this class has been moved to
+ * {@link AbstractPaperVersionFetcher}.
+ * {@link org.galemc.gale.version.AbstractPaperVersionFetcher}.
+ */
@DefaultQualifier(NonNull.class)
-public class PaperVersionFetcher implements VersionFetcher {
@@ -316,7 +286,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6fca13221ef3e0bbcad2ebbe74d6aadf
- private static final int DISTANCE_ERROR = -1;
- private static final int DISTANCE_UNKNOWN = -2;
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
+public class PaperVersionFetcher extends AbstractPaperVersionFetcher {
+public class PaperVersionFetcher extends org.galemc.gale.version.AbstractPaperVersionFetcher {
- @Override
- public long getCacheTime() {
@@ -374,7 +344,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6fca13221ef3e0bbcad2ebbe74d6aadf
private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
try {
@@ -105,42 +61,4 @@ public class PaperVersionFetcher implements VersionFetcher {
@@ -105,42 +75,4 @@ public class PaperVersionFetcher implements VersionFetcher {
return DISTANCE_ERROR;
}
}

View File

@@ -38,22 +38,10 @@ index 7620c72a4c243cbeea245203ce03a97cbfa7d922..29796a404e210f7864f4b33b3367e025
JSONObject object = new JSONObject();
for (String key : config.getKeys(false)) {
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df62ce75166 100644
index 87e5f614ba988547a827486740db217e28585773..cdb216e596f83139a63864fd6a9e4cf025dfb22e 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -7,8 +7,11 @@ import io.papermc.paper.configuration.constraint.Constraint;
import io.papermc.paper.configuration.constraint.Constraints;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.GameRules;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.file.YamlConfiguration;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.MustBeInvokedByOverriders;
import org.slf4j.Logger;
@@ -96,7 +99,7 @@ public abstract class Configurations<G, W> {
@@ -96,7 +96,7 @@ public abstract class Configurations<G, W> {
};
}
@@ -62,7 +50,7 @@ index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df6
return node -> {
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
@@ -170,7 +173,7 @@ public abstract class Configurations<G, W> {
@@ -170,7 +170,7 @@ public abstract class Configurations<G, W> {
final YamlConfigurationLoader loader = result.loader();
final ConfigurationNode node = loader.load();
if (result.isNewFile()) { // add version to new files
@@ -71,7 +59,7 @@ index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df6
} else {
this.verifyWorldConfigVersion(contextMap, node);
}
@@ -232,7 +235,7 @@ public abstract class Configurations<G, W> {
@@ -232,7 +232,7 @@ public abstract class Configurations<G, W> {
.build();
final ConfigurationNode worldNode = worldLoader.load();
if (newFile) { // set the version field if new file
@@ -80,7 +68,7 @@ index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df6
} else {
this.verifyWorldConfigVersion(contextMap, worldNode);
}
@@ -358,4 +361,25 @@ public abstract class Configurations<G, W> {
@@ -358,4 +358,25 @@ public abstract class Configurations<G, W> {
return "ContextKey{" + this.name + "}";
}
}
@@ -91,12 +79,12 @@ index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df6
+ public static final String legacyWorldDefaultsSectionKey = "__defaults__";
+
+ @Deprecated
+ public YamlConfiguration createLegacyObject(final MinecraftServer server) {
+ YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
+ ConfigurationSection worlds = global.createSection(legacyWorldsSectionKey);
+ worlds.set(legacyWorldDefaultsSectionKey, YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.defaultWorldConfigFileName).toFile()));
+ public org.bukkit.configuration.file.YamlConfiguration createLegacyObject(final net.minecraft.server.MinecraftServer server) {
+ org.bukkit.configuration.file.YamlConfiguration global = org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
+ org.bukkit.configuration.ConfigurationSection worlds = global.createSection(legacyWorldsSectionKey);
+ worlds.set(legacyWorldDefaultsSectionKey, org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.defaultWorldConfigFileName).toFile()));
+ for (ServerLevel level : server.getAllLevels()) {
+ worlds.set(level.getWorld().getName(), YamlConfiguration.loadConfiguration(getWorldConfigFile(level).toFile()));
+ worlds.set(level.getWorld().getName(), org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(getWorldConfigFile(level).toFile()));
+ }
+ return global;
+ }
@@ -156,18 +144,10 @@ index 1029b6de6f36b08bf634b4056ef5701383f6f258..1dd9531ffa272b8248f78a9ec029edcd
+ // Gale end - Gale configuration
}
diff --git a/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java b/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c5f1c38da 100644
index 8f23276796037d048eb114952891a01a40971b3e..e8f527d7c09be660b539ec2b7a77e0182748b526 100644
--- a/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
+++ b/src/main/java/io/papermc/paper/configuration/mapping/InnerClassFieldDiscoverer.java
@@ -9,6 +9,7 @@ import java.lang.reflect.Field;
import java.util.Collections;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
+import org.galemc.gale.configuration.GaleWorldConfiguration;
import org.spongepowered.configurate.objectmapping.FieldDiscoverer;
import org.spongepowered.configurate.serialize.SerializationException;
@@ -48,7 +49,19 @@ public final class InnerClassFieldDiscoverer implements FieldDiscoverer<Map<Fiel
@@ -48,7 +48,19 @@ public final class InnerClassFieldDiscoverer implements FieldDiscoverer<Map<Fiel
return new InnerClassFieldDiscoverer(overrides);
}
@@ -175,7 +155,7 @@ index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c
+ // Gale start - Gale configuration
+ public static FieldDiscoverer<?> galeWorldConfig(Configurations.ContextMap contextMap) {
+ final Map<Class<?>, Object> overrides = Map.of(
+ GaleWorldConfiguration.class, new GaleWorldConfiguration(
+ org.galemc.gale.configuration.GaleWorldConfiguration.class, new org.galemc.gale.configuration.GaleWorldConfiguration(
+ contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(),
+ contextMap.require(Configurations.WORLD_KEY)
+ )
@@ -189,34 +169,14 @@ index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939be92f87d6 100644
index 696d075ca2883f3c37e35f983c4d020e5db89d16..630a25580b10fb8371c95c61ae2740d3980a1043 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,9 +3,6 @@ package net.minecraft.server;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
-import co.aikar.timings.Timings;
-import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
-import com.google.common.base.Stopwatch;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -149,6 +146,9 @@ import net.minecraft.world.level.levelgen.WorldOptions;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
import net.minecraft.world.level.storage.WorldData;
+import net.minecraft.world.phys.Vec2;
+import net.minecraft.world.phys.Vec3;
+import org.galemc.gale.configuration.GaleConfigurations;
import org.slf4j.Logger;
// CraftBukkit start
@@ -317,6 +317,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 3 ];
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
+ public final GaleConfigurations galeConfigurations; // Gale - Gale configuration
+ public final org.galemc.gale.configuration.GaleConfigurations galeConfigurations; // Gale - Gale configuration
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
public volatile Thread shutdownThread; // Paper
@@ -229,18 +189,15 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1840332f79c5cfc2a913d80d9885939b
private void readScoreboard(DimensionDataStorage persistentStateManager) {
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..67d4a82f371a4772128cc2218fd0a18ce7500b4f 100644
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..a79aca2677527e86d66383887fe3a787c25bab1d 100644
--- a/src/main/java/net/minecraft/server/Services.java
+++ b/src/main/java/net/minecraft/server/Services.java
@@ -10,13 +10,14 @@ import javax.annotation.Nullable;
import net.minecraft.server.players.GameProfileCache;
import net.minecraft.util.SignatureValidator;
@@ -12,11 +12,11 @@ import net.minecraft.util.SignatureValidator;
+import org.galemc.gale.configuration.GaleConfigurations;
public record Services(
- MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations // Paper - add paper configuration files
+ MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable GaleConfigurations galeConfigurations // Paper - add paper configuration files // Gale - Gale configuration
+ MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @javax.annotation.Nullable org.galemc.gale.configuration.GaleConfigurations galeConfigurations // Paper - add paper configuration files // Gale - Gale configuration
) {
// Paper start - add paper configuration files
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
@@ -249,25 +206,25 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..67d4a82f371a4772128cc2218fd0a18c
}
@Override
@@ -24,6 +25,11 @@ public record Services(
@@ -24,6 +24,11 @@ public record Services(
return java.util.Objects.requireNonNull(this.paperConfigurations);
}
// Paper end - add paper configuration files
+ // Gale start - Gale configuration
+ public GaleConfigurations galeConfigurations() {
+ public org.galemc.gale.configuration.GaleConfigurations galeConfigurations() {
+ return java.util.Objects.requireNonNull(this.galeConfigurations);
+ }
+ // Gale end - Gale configuration
public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
public static Services create(YggdrasilAuthenticationService authenticationService, File rootDirectory, File userCacheFile, joptsimple.OptionSet optionSet) throws Exception { // Paper - add optionset to load paper config files; add userCacheFile parameter
@@ -34,7 +40,10 @@ public record Services(
@@ -34,7 +39,10 @@ public record Services(
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
+ // Gale start - Gale configuration
+ GaleConfigurations galeConfigurations = GaleConfigurations.setup(configDirPath);
+ org.galemc.gale.configuration.GaleConfigurations galeConfigurations = org.galemc.gale.configuration.GaleConfigurations.setup(configDirPath);
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, galeConfigurations);
+ // Gale end - Gale configuration
// Paper end - load paper config files from cli options
@@ -302,53 +259,28 @@ index f9abf63e12ea930275121b470e4e4906cff0fc12..e20b7a1ad141834a10c5f23f9b27cc41
this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 507671476c3d2d92a2fdb05be24443af27d26dcf..32cd737206dd9f2bcfdacfe17dc0621ee34b589a 100644
index 507671476c3d2d92a2fdb05be24443af27d26dcf..1d746872b4292aec800db04a7d224e667207df8c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -12,7 +12,6 @@ import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
-import net.minecraft.ReportedException;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
@@ -42,8 +41,6 @@ import net.minecraft.world.TickRateManager;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageSources;
import net.minecraft.world.entity.Entity;
-import net.minecraft.world.entity.boss.EnderDragonPart;
-import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -101,6 +98,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.block.BlockPhysicsEvent;
+import org.galemc.gale.configuration.GaleWorldConfiguration;
// CraftBukkit end
public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel, ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemEntityGetter, ca.spottedleaf.moonrise.patches.collisions.world.CollisionLevel { // Paper - rewrite chunk system // Paper - optimise collisions
@@ -171,6 +169,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -171,6 +171,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
return this.paperConfig;
}
// Paper end - add paper world config
+ // Gale start - Gale configuration
+ private final GaleWorldConfiguration galeConfig;
+ public GaleWorldConfiguration galeConfig() {
+ private final org.galemc.gale.configuration.GaleWorldConfiguration galeConfig;
+ public org.galemc.gale.configuration.GaleWorldConfiguration galeConfig() {
+ return this.galeConfig;
+ }
+ // Gale end - Gale configuration
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -684,9 +688,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -684,9 +690,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.galemc.gale.configuration.GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
+ this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration

View File

@@ -13,22 +13,14 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 86c615518e315dd4425d17df163e88a150a4ef7c..8306edb6fb28e90ba4b432a07131e063daa70507 100644
index 86c615518e315dd4425d17df163e88a150a4ef7c..a8511bca9d49f470824f258f4c2c423e93c96ae2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -57,6 +57,7 @@ import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource;
+import org.galemc.gale.command.GaleCommands;
import org.slf4j.Logger;
// CraftBukkit start
@@ -240,6 +241,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -240,6 +240,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
+ GaleCommands.registerCommands(this); // Gale - Gale commands - register commands
+ org.galemc.gale.command.GaleCommands.registerCommands(this); // Gale - Gale commands - register commands
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now

View File

@@ -164,10 +164,10 @@ index e9775b4506909bee65a74964f0d5391a0513de1d..1c4dd8acdcd571aceffe4b78599ca2c7
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1840332f79c5cfc2a913d80d9885939be92f87d6..161904cc1d802d9b113f68c2eb46a1c7a7c1b425 100644
index 630a25580b10fb8371c95c61ae2740d3980a1043..5fd175eeeb7237b2e7df9087a3c218221311487b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -103,18 +103,9 @@ import net.minecraft.util.datafix.DataFixers;
@@ -106,18 +106,9 @@ import net.minecraft.util.datafix.DataFixers;
import net.minecraft.util.debugchart.RemoteDebugSampleType;
import net.minecraft.util.debugchart.SampleLogger;
import net.minecraft.util.debugchart.TpsDebugDimensions;
@@ -668,10 +668,10 @@ index 8c587f829c5e8c6b6df3150024c4ae704988c47b..9f00cd7d23710787d0cb94377f21a541
String string = String.format(
Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId()
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8306edb6fb28e90ba4b432a07131e063daa70507..8538024c6345e79d08643e2d68ca146542b7860a 100644
index a8511bca9d49f470824f258f4c2c423e93c96ae2..ec000ec87a6fffe90d1847f048ce413396797385 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -891,12 +891,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -890,12 +890,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return this.settings.getProperties().serverResourcePackInfo;
}
@@ -1847,10 +1847,10 @@ index f696afd7e241bf1966a2d505b5d59bff824b43e4..94e0a6cdf5c340dd11374e890963d043
if (this.fire) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f0650c1ebeef 100644
index 1d746872b4292aec800db04a7d224e667207df8c..0f14d14bceb4dd6f1d74ab2ddf05f383050b3a62 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -133,7 +133,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -135,7 +135,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
@@ -1858,7 +1858,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
public final boolean isClientSide;
private final WorldBorder worldBorder;
private final BiomeManager biomeManager;
@@ -229,7 +228,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -231,7 +230,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final <T extends Entity> List<T> getEntitiesOfClass(final Class<T> entityClass, final AABB boundingBox, final Predicate<? super T> predicate) {
@@ -1866,7 +1866,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
final List<T> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate);
@@ -239,7 +237,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -241,7 +239,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final List<Entity> moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate<? super Entity> predicate) {
@@ -1874,16 +1874,16 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
final List<Entity> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
@@ -688,7 +685,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -690,7 +687,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.galemc.gale.configuration.GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.galemc.gale.configuration.GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
@@ -703,7 +700,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -705,7 +702,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// CraftBukkit end
@@ -1891,7 +1891,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
this.levelData = worlddatamutable;
this.dimensionTypeRegistration = holder;
final DimensionType dimensionmanager = (DimensionType) holder.value();
@@ -1371,9 +1367,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1373,9 +1369,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
protected void tickBlockEntities() {
@@ -1901,7 +1901,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
this.timings.tileEntityPending.startTiming(); // Spigot
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1416,7 +1409,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1418,7 +1411,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
this.timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false;
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
@@ -1909,7 +1909,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1645,7 +1637,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1647,7 +1639,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
@@ -1917,7 +1917,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
// Paper start - rewrite chunk system
final List<Entity> ret = new java.util.ArrayList<>();
@@ -1671,8 +1662,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1673,8 +1664,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public <T extends Entity> void getEntities(final EntityTypeTest<Entity, T> entityTypeTest,
final AABB boundingBox, final Predicate<? super T> predicate,
final List<? super T> into, final int maxCount) {
@@ -1926,7 +1926,7 @@ index 32cd737206dd9f2bcfdacfe17dc0621ee34b589a..9dfc38c1b062c8ad52ecff4b0731f065
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
if (maxCount != Integer.MAX_VALUE) {
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(byType, boundingBox, into, predicate, maxCount);
@@ -1966,11 +1955,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1968,11 +1957,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
public ProfilerFiller getProfiler() {

View File

@@ -31,10 +31,10 @@ 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/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 9dfc38c1b062c8ad52ecff4b0731f0650c1ebeef..4aa38c29fa18f321b70fa58f308a4c15b03d61d3 100644
index 0f14d14bceb4dd6f1d74ab2ddf05f383050b3a62..accd54816b72879d30b52a42b769a16ae8bd14b6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -685,6 +685,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -687,6 +687,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
@@ -46,11 +46,10 @@ index 9dfc38c1b062c8ad52ecff4b0731f0650c1ebeef..4aa38c29fa18f321b70fa58f308a4c15
+ @Override public final int getMinBuildHeight() { return this.minBuildHeight; }
+ @Override public final int getHeight() { return this.height; }
+ // Gale end - Airplane - inline level height
+
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.galemc.gale.configuration.GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -704,6 +713,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -706,6 +714,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
this.dimensionTypeRegistration = holder;
final DimensionType dimensionmanager = (DimensionType) holder.value();

View File

@@ -57,10 +57,10 @@ index 4e9c49496c3d26b59eaa37662aefb73e8a48c5ee..5bfab30730304614bcd0ea3d558ad458
}
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 4aa38c29fa18f321b70fa58f308a4c15b03d61d3..0b373e194a4cf1d579165424aee21f4c62ae45b1 100644
index accd54816b72879d30b52a42b769a16ae8bd14b6..2c42538d5c5334662f5df61c2cad39ae676d067b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1432,15 +1432,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1433,15 +1433,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
try {
tickConsumer.accept(entity);
} catch (Throwable throwable) {

View File

@@ -84,34 +84,17 @@ index 66477f772ffb9271cf647dfb7567d75c3d5145fb..13a51c939b8bd17584a4742178231506
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8538024c6345e79d08643e2d68ca146542b7860a..94e86acd4bc9c2be7c07fbd17364ba7bf9edb094 100644
index ec000ec87a6fffe90d1847f048ce413396797385..e9523a7a94a26c524e3179f2d8e74be6cad06b1a 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -20,6 +20,8 @@ import java.util.Locale;
import java.util.Optional;
import java.util.function.BooleanSupplier;
import javax.annotation.Nullable;
+
+import gg.pufferfish.pufferfish.simd.SIMDDetection;
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.DefaultUncaughtExceptionHandlerWithName;
import net.minecraft.SharedConstants;
@@ -58,6 +60,7 @@ import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
import net.minecraft.world.level.storage.LevelStorageSource;
import org.galemc.gale.command.GaleCommands;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
// CraftBukkit start
@@ -246,6 +249,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -245,6 +245,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
+ // Gale start - Pufferfish - SIMD support
+ // Initialize vectorization
+ try {
+ SIMDDetection.initialize();
+ gg.pufferfish.pufferfish.simd.SIMDDetection.initialize();
+ } catch (Throwable ignored) {}
+ // Gale start - Pufferfish - SIMD support
+

View File

@@ -7,45 +7,28 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..f962e82e2c70f328a23dc99193d072f8dd7ad949 100644
index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..506c746980cfca170efd249d035a572361b667c4 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -44,6 +44,8 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
+
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.intellij.lang.annotations.Subst;
import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection;
@@ -317,7 +319,7 @@ public final class ChatProcessor {
@@ -317,7 +317,7 @@ public final class ChatProcessor {
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure"); // Gale - do not log Not Secure marker
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, !org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure"); // Gale - do not log Not Secure marker
}
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 17e122612ae50c06872d666e435b08d30cf9a6cc..d0862e9c83e2b167fe6510fba1a50f0fdb0bf5c7 100644
index 17e122612ae50c06872d666e435b08d30cf9a6cc..649a7450e6d0cf6209df35ca2da9d66eb3872254 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -102,6 +102,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
// CraftBukkit start
@@ -1397,7 +1398,7 @@ public abstract class PlayerList {
@@ -1397,7 +1397,7 @@ public abstract class PlayerList {
// Paper end
boolean flag = this.verifyChatTrusted(message);
- this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
+ this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag || !GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
+ this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag || !org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.notSecureMarker ? null : "Not Secure"); // Paper // Gale - do not log Not Secure marker
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
boolean flag1 = false;

View File

@@ -17,23 +17,15 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
This can help to hide annoying scanning bots from showing up in console.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 40638b439966619e9c70a18a32abd95b2178fe9f..2754e5dda2bc50bff302cb569803bc8f1f04a9db 100644
index 40638b439966619e9c70a18a32abd95b2178fe9f..d9b48200596aea7476a9422beaf0939c6e66b5d3 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -44,6 +44,7 @@ import net.minecraft.util.CryptException;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringUtil;
import org.apache.commons.lang3.Validate;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketUtils;
@@ -146,6 +147,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -146,6 +146,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
public void disconnect(Component reason) {
try {
+ // Gale start - Pufferfish - do not log disconnections with null id
+ if (!GaleGlobalConfiguration.get().logToConsole.nullIdDisconnections && this.authenticatedProfile != null && this.authenticatedProfile.getId() == null) {
+ if (!org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.nullIdDisconnections && this.authenticatedProfile != null && this.authenticatedProfile.getId() == null) {
+ var reasonString = reason.getString();
+ if ("Disconnected".equals(reasonString) || Component.translatable("multiplayer.disconnect.generic").getString().equals(reasonString)) {
+ return;

View File

@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 94e86acd4bc9c2be7c07fbd17364ba7bf9edb094..8cbad64897ea764a10f044cabb8f77ffbcb3a7a0 100644
index e9523a7a94a26c524e3179f2d8e74be6cad06b1a..00bb3fa5196a26a0f69bb0cf2a5280b8b2cd5af3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -201,7 +201,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -197,7 +197,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
// Paper start - detect running as root

View File

@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8cbad64897ea764a10f044cabb8f77ffbcb3a7a0..30ddaba93a1b2bb228a9fcdf25e8abab036d9f38 100644
index 00bb3fa5196a26a0f69bb0cf2a5280b8b2cd5af3..c3c817e21c43ad186c5668e5605e70d3b08c1b16 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -314,7 +314,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -310,7 +310,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
// Paper end - Add Velocity IP Forwarding Support

View File

@@ -13,14 +13,14 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d0862e9c83e2b167fe6510fba1a50f0fdb0bf5c7..4eb66937b937d46979a6fa0f24f10d6812e8a436 100644
index 649a7450e6d0cf6209df35ca2da9d66eb3872254..274c87e23f129e68e50a575b03ee2d88f56717a9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -483,7 +483,13 @@ public abstract class PlayerList {
@@ -482,7 +482,13 @@ public abstract class PlayerList {
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
}
// Paper end - Configurable player collision
+ if (GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
+ // Gale start - JettPack - make logging login location configurable
+ } else {

View File

@@ -377,10 +377,10 @@ index b9fd0526e244ee3eb16b82f80ad3818ec55929e0..c507dbfe5bb793d896acda167fb6d0f2
ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); // Paper - fix slot desync - always refresh player inventory
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 2754e5dda2bc50bff302cb569803bc8f1f04a9db..1d4f1cdfd2b221b0ed0cef3bc266c829fd3555ef 100644
index d9b48200596aea7476a9422beaf0939c6e66b5d3..5e3613aae16ab6cdb42868dbf4bade66169401da 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -181,14 +181,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -180,14 +180,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
@@ -399,7 +399,7 @@ index 2754e5dda2bc50bff302cb569803bc8f1f04a9db..1d4f1cdfd2b221b0ed0cef3bc266c829
this.requestedUsername = packet.name();
GameProfile gameprofile = this.server.getSingleplayerProfile();
@@ -284,7 +286,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -283,7 +285,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleKey(ServerboundKeyPacket packet) {
@@ -408,7 +408,7 @@ index 2754e5dda2bc50bff302cb569803bc8f1f04a9db..1d4f1cdfd2b221b0ed0cef3bc266c829
final String s;
@@ -465,7 +467,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -464,7 +466,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleLoginAcknowledgement(ServerboundLoginAcknowledgedPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.server); // CraftBukkit
@@ -625,10 +625,10 @@ index fce49b17905ab97e691aa8499a5dfed67adf0c40..986d0151aeeb2ce0f752c424c526fb0c
if (stackPredicate.test(itemStack)) {
ItemEnchantments itemEnchantments = itemStack.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0b373e194a4cf1d579165424aee21f4c62ae45b1..a28385bbc885f2103093a80066c89f09b650484a 100644
index 2c42538d5c5334662f5df61c2cad39ae676d067b..6bdbe2982e418b91b2e569ac0702ac1b57f7224e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1738,7 +1738,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1739,7 +1739,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {

View File

@@ -8,7 +8,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/alloc/explosion_behavior/EntityExplosionBehaviorMixin.java"
"net/caffeinemc/mods/lithium/mixin/alloc/explosion_behavior/EntityExplosionBehaviorMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,30 +7,21 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/collections/gamerules/GameRulesMixin.java"
"net/caffeinemc/mods/lithium/mixin/collections/gamerules/GameRulesMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 89e327bc3a45879fe68887c7aadb077f31a770eb..a90ebe3fd345034c85e95d4dddf3223ac5374b30 100644
index 89e327bc3a45879fe68887c7aadb077f31a770eb..14f21717f418e4c2b02a56a745381e48bc0bbb68 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -21,6 +21,8 @@ import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
import javax.annotation.Nullable;
+
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.nbt.CompoundTag;
@@ -149,7 +151,7 @@ public class GameRules {
@@ -149,7 +149,7 @@ public class GameRules {
}
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) {
- this.rules = rules;
+ this.rules = new Object2ObjectOpenHashMap<>(rules); // Gale - Lithium - replace game rules map with optimized collection
+ this.rules = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(rules); // Gale - Lithium - replace game rules map with optimized collection
// Paper start - Perf: Use array for gamerule storage
int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1;

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/collections/attributes/AttributeContainerMixin.java"
"net/caffeinemc/mods/lithium/mixin/collections/attributes/AttributeContainerMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/collections/entity_by_type/TypeFilterableListMixin.java"
"net/caffeinemc/mods/lithium/mixin/collections/entity_by_type/TypeFilterableListMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/cached_hashcode/BlockNeighborGroupMixin.java"
"net/caffeinemc/mods/lithium/mixin/cached_hashcode/BlockNeighborGroupMixin.java"
By: Angeline <jellysquid3@users.noreply.github.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/shapes/precompute_shape_arrays/FractionalDoubleListMixin.java"
"net/caffeinemc/mods/lithium/mixin/shapes/precompute_shape_arrays/FractionalDoubleListMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/entity/fast_powder_snow_check/LivingEntityMixin.java"
"net/caffeinemc/mods/lithium/mixin/entity/fast_powder_snow_check/LivingEntityMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,23 +7,23 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixins and classes:
* "me/jellysquid/mods/lithium/common/world/chunk/CompactingPackedIntegerArray.java"
* "me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java"
* "me/jellysquid/mods/lithium/mixin/chunk/serialization/PackedIntegerArrayMixin.java"
* "me/jellysquid/mods/lithium/mixin/chunk/serialization/PalettedContainerMixin.java"
* "net/caffeinemc/mods/lithium/common/world/chunk/CompactingPackedIntegerArray.java"
* "net/caffeinemc/mods/lithium/common/world/chunk/LithiumHashPalette.java"
* "net/caffeinemc/mods/lithium/mixin/chunk/serialization/PackedIntegerArrayMixin.java"
* "net/caffeinemc/mods/lithium/mixin/chunk/serialization/PalettedContainerMixin.java"
By: Angeline <jellysquid3@users.noreply.github.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java
diff --git a/src/main/java/net/caffeinemc/mods/lithium/common/world/chunk/LithiumHashPalette.java b/src/main/java/net/caffeinemc/mods/lithium/common/world/chunk/LithiumHashPalette.java
new file mode 100644
index 0000000000000000000000000000000000000000..349618b7f544bf9a30e0796d4d9a26407a2b8329
index 0000000000000000000000000000000000000000..de160b56e3e565038394ecac7a78e156f5201f05
--- /dev/null
+++ b/src/main/java/me/jellysquid/mods/lithium/common/world/chunk/LithiumHashPalette.java
+++ b/src/main/java/net/caffeinemc/mods/lithium/common/world/chunk/LithiumHashPalette.java
@@ -0,0 +1,192 @@
+// Gale - Lithium - faster chunk serialization
+
+package me.jellysquid.mods.lithium.common.world.chunk;
+package net.caffeinemc.mods.lithium.common.world.chunk;
+
+import com.google.common.collect.ImmutableList;
+import it.unimi.dsi.fastutil.HashCommon;
@@ -214,44 +214,28 @@ index 0000000000000000000000000000000000000000..349618b7f544bf9a30e0796d4d9a2640
+ }
+}
diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java
index 19661e106612b8e4e152085fb398db7bd06acc23..f852d2c0c0e37df78dbea28e183aee3572978dee 100644
index 19661e106612b8e4e152085fb398db7bd06acc23..3d7f740cbabdd08a3fc5a325b3dee4f4547df034 100644
--- a/src/main/java/net/minecraft/util/BitStorage.java
+++ b/src/main/java/net/minecraft/util/BitStorage.java
@@ -1,6 +1,7 @@
package net.minecraft.util;
import java.util.function.IntConsumer;
+import net.minecraft.world.level.chunk.Palette;
public interface BitStorage extends ca.spottedleaf.moonrise.patches.block_counting.BlockCountingBitStorage { // Paper - block counting
int getAndSet(int index, int value);
@@ -38,4 +39,6 @@ public interface BitStorage extends ca.spottedleaf.moonrise.patches.block_counti
@@ -38,4 +38,6 @@ public interface BitStorage extends ca.spottedleaf.moonrise.patches.block_counti
return ret;
}
// Paper end - block counting
+
+ <T> void compact(Palette<T> srcPalette, Palette<T> dstPalette, short[] out); // Gale - Lithium - faster chunk serialization
+ <T> void compact(net.minecraft.world.level.chunk.Palette<T> srcPalette, net.minecraft.world.level.chunk.Palette<T> dstPalette, short[] out); // Gale - Lithium - faster chunk serialization
}
diff --git a/src/main/java/net/minecraft/util/SimpleBitStorage.java b/src/main/java/net/minecraft/util/SimpleBitStorage.java
index 8acf2f2491a8d9d13392c5e89b2bd5c9918285e1..0b8b0cf58f637d72eae28e21266df14183f11fb1 100644
index 8acf2f2491a8d9d13392c5e89b2bd5c9918285e1..5ff7b2c9d97cb428b7a3a54bd53ab385afe92ce1 100644
--- a/src/main/java/net/minecraft/util/SimpleBitStorage.java
+++ b/src/main/java/net/minecraft/util/SimpleBitStorage.java
@@ -2,6 +2,7 @@ package net.minecraft.util;
import java.util.function.IntConsumer;
import javax.annotation.Nullable;
+import net.minecraft.world.level.chunk.Palette;
import org.apache.commons.lang3.Validate;
public class SimpleBitStorage implements BitStorage {
@@ -401,4 +402,45 @@ public class SimpleBitStorage implements BitStorage {
@@ -401,4 +401,45 @@ public class SimpleBitStorage implements BitStorage {
super(message);
}
}
+
+ // Gale start - Lithium - faster chunk serialization
+ @Override
+ public <T> void compact(Palette<T> srcPalette, Palette<T> dstPalette, short[] out) {
+ public <T> void compact(net.minecraft.world.level.chunk.Palette<T> srcPalette, net.minecraft.world.level.chunk.Palette<T> dstPalette, short[] out) {
+ if (this.size >= Short.MAX_VALUE) {
+ throw new IllegalStateException("Array too large");
+ }
@@ -313,14 +297,11 @@ index acae3eb30e0689048937f479dc3070f0688abdad..4b79f0474a9013dd4fdb68c6363ca194
int onResize(int newBits, T object);
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f19ed19c37 100644
index 13d3c877b006a4975e7370713e3919c661e7890f..15f3f68dfa933432f163218ccc9f66b9baef0d9d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -23,8 +23,25 @@ import net.minecraft.util.Mth;
import net.minecraft.util.SimpleBitStorage;
import net.minecraft.util.ThreadingDetector;
@@ -25,6 +25,22 @@ import net.minecraft.util.ThreadingDetector;
import net.minecraft.util.ZeroBitStorage;
+import me.jellysquid.mods.lithium.common.world.chunk.LithiumHashPalette;
public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainerRO<T> {
+
@@ -342,7 +323,7 @@ index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f1
private static final int MIN_PALETTE_BITS = 0;
private final PaletteResize<T> dummyPaletteResize = (newSize, added) -> 0;
public final IdMap<T> registry;
@@ -304,28 +321,54 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
@@ -304,28 +320,54 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
public synchronized PalettedContainerRO.PackedData<T> pack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider) { // Paper - synchronize
this.acquire();
@@ -364,20 +345,20 @@ index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f1
- } else {
- optional = Optional.empty();
+ // The palette that will be serialized
+ LithiumHashPalette<T> hashPalette = null;
+ net.caffeinemc.mods.lithium.common.world.chunk.LithiumHashPalette<T> hashPalette = null;
+
+ final Palette<T> palette = this.data.palette();
+ final BitStorage storage = this.data.storage();
+ if (storage instanceof ZeroBitStorage || palette.getSize() == 1) {
+ // If the palette only contains one entry, don't attempt to repack it.
+ elements = List.of(palette.valueFor(0));
+ } else if (palette instanceof LithiumHashPalette<T> lithiumHashPalette) {
+ } else if (palette instanceof net.caffeinemc.mods.lithium.common.world.chunk.LithiumHashPalette<T> lithiumHashPalette) {
+ hashPalette = lithiumHashPalette;
}
- var12 = new PalettedContainerRO.PackedData<>(hashMapPalette.getEntries(), optional);
+ if (elements == null) {
+ LithiumHashPalette<T> compactedPalette = new LithiumHashPalette<>(idList, storage.getBits(), this.dummyPaletteResize);
+ net.caffeinemc.mods.lithium.common.world.chunk.LithiumHashPalette<T> compactedPalette = new net.caffeinemc.mods.lithium.common.world.chunk.LithiumHashPalette<>(idList, storage.getBits(), this.dummyPaletteResize);
+ short[] array = this.getOrCreate(paletteProvider.size());
+
+ storage.compact(this.data.palette(), compactedPalette, array);
@@ -412,7 +393,7 @@ index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f1
}
private static <T> void swapPalette(int[] is, IntUnaryOperator applier) {
@@ -364,13 +407,35 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
@@ -364,13 +406,35 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
@Override
public void count(PalettedContainer.CountConsumer<T> counter) {

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/ai/raid/RaidMixin.java"
"net/caffeinemc/mods/lithium/mixin/ai/raid/RaidMixin.java"
By: Angeline <jellysquid3@users.noreply.github.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/gen/cached_generator_settings/NoiseChunkGeneratorMixin.java"
"net/caffeinemc/mods/lithium/mixin/gen/cached_generator_settings/NoiseChunkGeneratorMixin.java"
By: SuperCoder7979 <k.pranav@gmail.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPointsOfInterestSensorMixin.java"
"net/caffeinemc/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPointsOfInterestSensorMixin.java"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb36b5d47fd 100644
index 274c87e23f129e68e50a575b03ee2d88f56717a9..af1ad9690d5fdd96f67837e952b0093d55b827ad 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -13,6 +13,8 @@ import java.net.SocketAddress;
@@ -49,7 +49,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
import java.util.Collection;
import java.util.EnumSet;
import java.util.Iterator;
@@ -134,10 +136,11 @@ public abstract class PlayerList {
@@ -133,10 +135,11 @@ public abstract class PlayerList {
public static final Component CHAT_FILTERED_FULL = Component.translatable("chat.filtered_full");
public static final Component DUPLICATE_LOGIN_DISCONNECT_MESSAGE = Component.translatable("multiplayer.disconnect.duplicate_login");
private static final Logger LOGGER = LogUtils.getLogger();
@@ -62,7 +62,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
private final UserBanList bans;
private final IpBanList ipBans;
@@ -328,6 +331,7 @@ public abstract class PlayerList {
@@ -327,6 +330,7 @@ public abstract class PlayerList {
// entityplayer.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below
this.players.add(player);
@@ -70,7 +70,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
this.playersByUUID.put(player.getUUID(), player);
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer))); // CraftBukkit - replaced with loop below
@@ -661,6 +665,7 @@ public abstract class PlayerList {
@@ -660,6 +664,7 @@ public abstract class PlayerList {
entityplayer.retireScheduler(); // Paper - Folia schedulers
entityplayer.getAdvancements().stopListening();
this.players.remove(entityplayer);
@@ -78,7 +78,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID();
@@ -817,6 +822,7 @@ public abstract class PlayerList {
@@ -816,6 +821,7 @@ public abstract class PlayerList {
public ServerPlayer respawn(ServerPlayer entityplayer, boolean flag, Entity.RemovalReason entity_removalreason, RespawnReason reason, Location location) {
entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer);
@@ -86,7 +86,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
entityplayer.serverLevel().removePlayerImmediately(entityplayer, entity_removalreason);
/* CraftBukkit start
@@ -903,6 +909,7 @@ public abstract class PlayerList {
@@ -902,6 +908,7 @@ public abstract class PlayerList {
if (!entityplayer.connection.isDisconnected()) {
worldserver.addRespawnedPlayer(entityplayer1);
this.players.add(entityplayer1);
@@ -94,7 +94,7 @@ index 4eb66937b937d46979a6fa0f24f10d6812e8a436..bea08b08d3cc29774d2ebc7c577eabb3
this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot
this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1);
}
@@ -986,20 +993,55 @@ public abstract class PlayerList {
@@ -985,20 +992,55 @@ public abstract class PlayerList {
this.sendPlayerPermissionLevel(player, i, recalculatePermissions); // Paper - avoid recalculating permissions if possible
}

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index bea08b08d3cc29774d2ebc7c577eabb36b5d47fd..487130545e58661c7757513f295977407ad19295 100644
index af1ad9690d5fdd96f67837e952b0093d55b827ad..949ecc013163b5d33631b9ca54b32ff5bf3d1dae 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1029,14 +1029,18 @@ public abstract class PlayerList {
@@ -1028,14 +1028,18 @@ public abstract class PlayerList {
// Gale start - Purpur - spread out sending all player info
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
if (sendAllPlayerInfoBucket != null) {

View File

@@ -7,16 +7,16 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 1d4f1cdfd2b221b0ed0cef3bc266c829fd3555ef..4e4f14ba35a1a5944c605dfd1784047d43e559ce 100644
index 5e3613aae16ab6cdb42868dbf4bade66169401da..cc426f77eb940982c495bb3037bebe78b7fcf504 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -127,7 +127,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -126,7 +126,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.finishLoginAndWaitForClient(this.authenticatedProfile);
}
- if (this.tick++ == 600) {
+ // Gale start - make slow login timeout configurable
+ int slowLoginTimeout = GaleGlobalConfiguration.get().misc.premiumAccountSlowLoginTimeout;
+ int slowLoginTimeout = org.galemc.gale.configuration.GaleGlobalConfiguration.get().misc.premiumAccountSlowLoginTimeout;
+ if (this.tick++ >= (slowLoginTimeout < 1 ? MAX_TICKS_BEFORE_LOGIN : slowLoginTimeout)) {
+ // Gale end - make slow login timeout configurable
this.disconnect(Component.translatable("multiplayer.disconnect.slow_login"));

View File

@@ -14,10 +14,10 @@ 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/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 487130545e58661c7757513f295977407ad19295..2ce40c153a3b08c5c5f1d7743d0135237e4a4d36 100644
index 949ecc013163b5d33631b9ca54b32ff5bf3d1dae..524c2374d2251edeb171d65e49deebf940e9ef38 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -275,6 +275,13 @@ public abstract class PlayerList {
@@ -274,6 +274,13 @@ public abstract class PlayerList {
org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation());
this.cserver.getPluginManager().callEvent(ev);