diff --git a/build.gradle.kts b/build.gradle.kts index 2caf34622..3f7fb6634 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,5 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent -import kotlin.io.path.createSymbolicLinkPointingTo plugins { java diff --git a/patches/server/0038-fixup-Optimize-default-configurations.patch b/patches/server/0038-fixup-Optimize-default-configurations.patch new file mode 100644 index 000000000..3d5ec56ad --- /dev/null +++ b/patches/server/0038-fixup-Optimize-default-configurations.patch @@ -0,0 +1,92 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 15 May 2024 14:28:43 +0900 +Subject: [PATCH] fixup! Optimize default configurations + + +diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +index cba3d725245223c5d9e8e59dcceec61f0acc1b85..63af4c9e2bc662e08ebf858d84933b3e4e3b92cb 100644 +--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java ++++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +@@ -72,7 +72,7 @@ public class PufferfishConfig { + getString("info.version", "1.0"); + setComment("info", + "Pufferfish Configuration", +- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", ++ // "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock + "Join our Discord for support: https://discord.gg/reZw4vQV9H", + "Download new builds at https://ci.pufferfish.host/job/Pufferfish"); + +@@ -227,7 +227,7 @@ public class PufferfishConfig { + public static int maxProjectileLoadsPerTick; + public static int maxProjectileLoadsPerProjectile; + private static void projectileLoading() { +- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); ++ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); + maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); + + setComment("projectile", "Optimizes projectile settings"); +@@ -241,12 +241,12 @@ public class PufferfishConfig { + public static int activationDistanceMod; + + private static void dynamicActivationOfBrains() throws IOException { +- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur ++ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur + startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, + "This value determines how far away an entity has to be", + "from the player to start being effected by DEAR."); + startDistanceSquared = startDistance * startDistance; +- maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20, ++ maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, + "This value defines how often in ticks, the furthest entity", + "will get their pathfinders and behaviors ticked. 20 = 1s"); + activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, +@@ -269,8 +269,18 @@ public class PufferfishConfig { + public static Map projectileTimeouts; + private static void projectileTimeouts() { + // Set some defaults +- getInt("entity_timeouts.SNOWBALL", -1); +- getInt("entity_timeouts.LLAMA_SPIT", -1); ++ // Plazma start - Optimize default configurations ++ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) { ++ getInt("entity_timeouts.ARROW", 200); ++ getInt("entity_timeouts.EGG", 200); ++ getInt("entity_timeouts.ENDER_PEARL", 200); ++ getInt("entity_timeouts.SNOWBALL", 200); ++ getInt("entity_timeouts.LLAMA_SPIT", 200); ++ } else { ++ getInt("entity_timeouts.SNOWBALL", -1); ++ getInt("entity_timeouts.LLAMA_SPIT", -1); ++ } ++ // Plazma end - Optimize default configurations + setComment("entity_timeouts", + "These values define a entity's maximum lifespan. If an", + "entity is in this list and it has survived for longer than", +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index 6c2a3813e7d63d57f07a8fa2edbb9d231221d818..f3b6719d265c1b81e7205cd82dac29b09d319d0c 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -197,8 +197,8 @@ public class SpigotConfig + public static String whitelistMessage; + public static String unknownCommandMessage; + public static String serverFullMessage; +- public static String outdatedClientMessage = "Outdated client! Please use {0}"; +- public static String outdatedServerMessage = "Outdated server! I\'m still on {0}"; ++ public static String outdatedClientMessage = ""; // Plazma - Optimize default configurations ++ public static String outdatedServerMessage = ""; // Plazma - Optimize default configurations + private static String transform(String s) + { + return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\\\n", "\n" ); +@@ -211,9 +211,9 @@ public class SpigotConfig + SpigotConfig.set( "messages.outdated-server", SpigotConfig.outdatedServerMessage ); + } + +- SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", "You are not whitelisted on this server!" ) ); +- SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", "Unknown command. Type \"/help\" for help." ) ); +- SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", "The server is full!" ) ); ++ SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", "" ) ); // Plazma - Optimize default configurations ++ SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", "" ) ); // Plazma - Optimize default configurations ++ SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", "" ) ); // Plazma - Optimize default configurations + SpigotConfig.outdatedClientMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-client", SpigotConfig.outdatedClientMessage ) ); + SpigotConfig.outdatedServerMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-server", SpigotConfig.outdatedServerMessage ) ); + } diff --git a/patches/unapplied/server/0015-Add-some-missing-Pufferfish-configurations.patch b/patches/server/0039-Add-some-missing-Pufferfish-configurations.patch similarity index 62% rename from patches/unapplied/server/0015-Add-some-missing-Pufferfish-configurations.patch rename to patches/server/0039-Add-some-missing-Pufferfish-configurations.patch index 444ae749e..86d10e3f7 100644 --- a/patches/unapplied/server/0015-Add-some-missing-Pufferfish-configurations.patch +++ b/patches/server/0039-Add-some-missing-Pufferfish-configurations.patch @@ -1,15 +1,31 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 -Date: Wed, 27 Sep 2023 18:29:51 +0900 +Date: Wed, 15 May 2024 14:30:55 +0900 Subject: [PATCH] Add some missing Pufferfish configurations +diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +index f8790ab5b7c1279719271ee57c00f4f2d6ce9714..9a9d6c05ceb5b62c4c0c72f64b047f783ae4aeb6 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java ++++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +@@ -128,9 +128,11 @@ public class Armadillo extends Animal { + return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic)); + } + ++ private int behaviorTick; // Plazma - Add missing pufferfish configurations + @Override + protected void customServerAiStep() { + //this.level().getProfiler().push("armadilloBrain"); // Purpur ++ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations + ((Brain) this.brain).tick((ServerLevel) this.level(), this); // CraftBukkit - decompile error + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("armadilloActivityUpdate"); // Purpur diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index 77c1bcde8cc5c2f51418a6f385ce84f202a13787..8ac2f6749f3bd85b73ac543bc9040aacb6032623 100644 +index fdc3aa9672077787e841d240fe1e690dcd9ca321..47d5db93adbb740c7b29dd9059bd31be91097a17 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -170,11 +170,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl - return dimensions.height - 0.1F * this.getScale(); +@@ -161,11 +161,13 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl + return pose == Pose.SITTING ? Camel.SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose); } + private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations @@ -17,16 +33,16 @@ index 77c1bcde8cc5c2f51418a6f385ce84f202a13787..8ac2f6749f3bd85b73ac543bc9040aac protected void customServerAiStep() { //this.level().getProfiler().push("camelBrain"); // Purpur Brain behaviorcontroller = (Brain) this.getBrain(); // CraftBukkit - decompile error -- + + if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations behaviorcontroller.tick((ServerLevel) this.level(), this); //this.level().getProfiler().pop(); // Purpur //this.level().getProfiler().push("camelActivityUpdate"); // Purpur diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 24e351b40745d15e065f4c3cd904596c6daf4cfb..aa60c4a251de2877a9b4ea72899f07194ce15ed7 100644 +index a2cc1efaa621861828b007759536ac49d7e3646e..6637bdb953428473edd3429740c75b67b634059a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -527,9 +527,11 @@ public class Sniffer extends Animal { +@@ -514,9 +514,11 @@ public class Sniffer extends Animal { return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES); } @@ -39,10 +55,10 @@ index 24e351b40745d15e065f4c3cd904596c6daf4cfb..aa60c4a251de2877a9b4ea72899f0719 //this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur SnifferAi.updateActivity(this); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 1f476a4fd148ac9a4c9ad5d12de46a16e4116239..707fd662c7f17986fffcabe774de176741456227 100644 +index 524d2304a1dbc873a47c95c55ad70c4120f07ad4..c9a8cbcaae0693c63ccdd05d271a524524c36754 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -@@ -320,7 +320,7 @@ public class Warden extends Monster implements VibrationSystem { +@@ -318,7 +318,7 @@ public class Warden extends Monster implements VibrationSystem { ServerLevel worldserver = (ServerLevel) this.level(); //worldserver.getProfiler().push("wardenBrain"); // Purpur diff --git a/patches/server/0040-Improve-biome-temperature-cache.patch b/patches/server/0040-Improve-biome-temperature-cache.patch new file mode 100644 index 000000000..08aecdabf --- /dev/null +++ b/patches/server/0040-Improve-biome-temperature-cache.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 15 May 2024 14:31:47 +0900 +Subject: [PATCH] Improve biome temperature cache + + +diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java +index f9fbfb63f19decb3b15284306d7edda072e609af..81b996679f396f18a8f5948311f1069be0806756 100644 +--- a/src/main/java/net/minecraft/world/level/biome/Biome.java ++++ b/src/main/java/net/minecraft/world/level/biome/Biome.java +@@ -118,7 +118,7 @@ public final class Biome { + public float getTemperature(BlockPos blockPos) { + long l = blockPos.asLong(); + // Pufferfish start +- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get(); ++ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve biome temperature cache + float f = cache.getValue(l); + if (!Float.isNaN(f)) { + return f; diff --git a/patches/unapplied/server/0012-Optimize-default-configurations.diff b/patches/unapplied/server/0012-Optimize-default-configurations.diff deleted file mode 100644 index e48dcdd3b..000000000 --- a/patches/unapplied/server/0012-Optimize-default-configurations.diff +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -index 8afc58f35deb49084a20b803e91ce4692ce6e4d6..1febd6d0743aadb4002b447c07ec43098ca96c18 100644 ---- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -@@ -64,7 +64,7 @@ public class PufferfishConfig { - getString("info.version", "1.0"); - setComment("info", - "Pufferfish Configuration", -- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", -+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock - "Join our Discord for support: https://discord.gg/reZw4vQV9H", - "Download new builds at https://ci.pufferfish.host/job/Pufferfish"); - -@@ -219,7 +219,7 @@ public class PufferfishConfig { - public static int maxProjectileLoadsPerTick; - public static int maxProjectileLoadsPerProjectile; - private static void projectileLoading() { -- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); -+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations - maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); - - setComment("projectile", "Optimizes projectile settings"); -@@ -233,7 +233,7 @@ public class PufferfishConfig { - public static int activationDistanceMod; - - private static void dynamicActivationOfBrains() throws IOException { -- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur -+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations - startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, - "This value determines how far away an entity has to be", - "from the player to start being effected by DEAR."); -@@ -241,7 +241,7 @@ public class PufferfishConfig { - maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20, - "This value defines how often in ticks, the furthest entity", - "will get their pathfinders and behaviors ticked. 20 = 1s"); -- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, -+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations - "This value defines how much distance modifies an entity's", - "tick frequency. freq = (distanceToPlayer^2) / (2^value)", - "If you want further away entities to tick less often, use 7.", -@@ -261,8 +261,18 @@ public class PufferfishConfig { - public static Map projectileTimeouts; - private static void projectileTimeouts() { - // Set some defaults -+ // Plazma start - Optimize default configurations -+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) { -+ getInt("entity_timeouts.ARROW", 200); -+ getInt("entity_timeouts.EGG", 200); -+ getInt("entity_timeouts.ENDER_PEARL", 200); -+ getInt("entity_timeouts.SNOWBALL", 200); -+ getInt("entity_timeouts.LLAMA_SPIT", 200); -+ } else { -+ // Plazma end - Optimize default configurations - getInt("entity_timeouts.SNOWBALL", -1); - getInt("entity_timeouts.LLAMA_SPIT", -1); -+ } // Plazma - Optimize default configurations - setComment("entity_timeouts", - "These values define a entity's maximum lifespan. If an", - "entity is in this list and it has survived for longer than", \ No newline at end of file diff --git a/patches/unapplied/server/0025-Improve-biome-temperture-cache.patch b/patches/unapplied/server/0025-Improve-biome-temperture-cache.patch deleted file mode 100644 index 0a3c87465..000000000 --- a/patches/unapplied/server/0025-Improve-biome-temperture-cache.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: AlphaKR93 -Date: Sat, 27 Apr 2024 14:14:49 +0900 -Subject: [PATCH] Improve biome temperture cache - - -diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java -index 0c317b0147a73a8075e0883f0c132f4db0bdfea7..97c5cc3e2e6721321d9c500e331cab1aee37a0fc 100644 ---- a/src/main/java/net/minecraft/world/level/biome/Biome.java -+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java -@@ -64,7 +64,7 @@ public final class Biome { - private final MobSpawnSettings mobSettings; - private final BiomeSpecialEffects specialEffects; - // Pufferfish start - use our cache -- private final ThreadLocal temperatureCache = ThreadLocal.withInitial(() -> Util.make(() -> { -+ private static final ThreadLocal temperatureCache = ThreadLocal.withInitial(() -> Util.make(() -> { // Plazma - Improve biome temperature cache - /* - Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { - protected void rehash(int i) { -@@ -118,7 +118,7 @@ public final class Biome { - public float getTemperature(BlockPos blockPos) { - long l = blockPos.asLong(); - // Pufferfish start -- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get(); -+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve biome temperature cache - float f = cache.getValue(l); - if (!Float.isNaN(f)) { - return f; diff --git a/patches/unapplied/server/0024-Configurable-cave-lava-sea-level.patch b/patches/unapplied/server/dropped/0024-Configurable-cave-lava-sea-level.patch similarity index 100% rename from patches/unapplied/server/0024-Configurable-cave-lava-sea-level.patch rename to patches/unapplied/server/dropped/0024-Configurable-cave-lava-sea-level.patch