diff --git a/.github/workflows/close-invalid-prs.yml b/.github/workflows/close-invalid-prs.yml deleted file mode 100644 index 62d0fddd9..000000000 --- a/.github/workflows/close-invalid-prs.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Close invalid PRs - -on: - pull_request_target: - types: [ opened ] - -jobs: - run: - if: ${{ github.repository != github.event.pull_request.head.repo.full_name && !startsWith(github.head_ref, 'ver/') }} - runs-on: ubuntu-22.04 - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: "Please do not open pull requests from the `master` branch, create a new branch instead." diff --git a/patches/server/0005-Rebrand.patch b/patches/server/0005-Rebrand.patch index 2ec6df54c..d84985f71 100644 --- a/patches/server/0005-Rebrand.patch +++ b/patches/server/0005-Rebrand.patch @@ -153,10 +153,10 @@ index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52 stringbuilder.append("// "); stringbuilder.append(CrashReport.getErrorComment()); diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..ed7bcd832340a7a46897f0275c99e72b7247a5de 100644 +index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..6f8b44bdf4d419b2bf0982dc209def53e4b4763c 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -111,6 +111,18 @@ public class Main { +@@ -111,6 +111,19 @@ public class Main { */ // CraftBukkit end try { @@ -169,7 +169,8 @@ index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..ed7bcd832340a7a46897f0275c99e72b + \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃ + \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛ + """); -+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server."); ++ if (org.plazmamc.plazma.Options.iKnowWhatIAmDoing) ++ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server."); + // Plazma end + // Paper start @@ -321,6 +322,19 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616 } + // Plazma end } +diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java +new file mode 100644 +index 0000000000000000000000000000000000000000..a858b7ddef7f6877c0b92f4150e0dd37bea121aa +--- /dev/null ++++ b/src/main/java/org/plazmamc/plazma/Options.java +@@ -0,0 +1,7 @@ ++package org.plazmamc.plazma; ++ ++public interface Options { ++ ++ boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing"); ++ ++} diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java diff --git a/patches/server/0009-Optimize-Default-Configurations.patch b/patches/server/0009-Optimize-Default-Configurations.patch index 573133170..f09e323cf 100644 --- a/patches/server/0009-Optimize-Default-Configurations.patch +++ b/patches/server/0009-Optimize-Default-Configurations.patch @@ -7,7 +7,7 @@ Original: YouHaveTrouble/minecraft-optimization, YouHaveTrouble/minecraft-exploi Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -index 3e36958365bc136516bafbaad0c168f7956406f1..47e96912f8cde6e6988b5d609a4fbd8e00b126cb 100644 +index 3e36958365bc136516bafbaad0c168f7956406f1..78bd9082366ea678c1ee4107b69845062eeede86 100644 --- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java @@ -211,8 +211,8 @@ public class PufferfishConfig { @@ -18,12 +18,12 @@ index 3e36958365bc136516bafbaad0c168f7956406f1..47e96912f8cde6e6988b5d609a4fbd8e - maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); + maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma + 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"); } @@ -225,16 +225,16 @@ public class PufferfishConfig { public static int activationDistanceMod; - + private static void dynamicActivationOfBrains() throws IOException { - dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur - startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, @@ -64,21 +64,21 @@ index 3e36958365bc136516bafbaad0c168f7956406f1..47e96912f8cde6e6988b5d609a4fbd8e "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/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 3bc7230ca62ebe3426da293e436a962bb0134f85..766e518c6a3b3e684f5fda65a680b5378c9c0479 100644 +index 3bc7230ca62ebe3426da293e436a962bb0134f85..af7dd492435f66877078a69310c20c42757525f2 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java @@ -143,7 +143,7 @@ public class GlobalConfiguration extends ConfigurationPart { - + public class Watchdog extends ConfigurationPart { public int earlyWarningEvery = 5000; - public int earlyWarningDelay = 10000; + public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations } - + public SpamLimiter spamLimiter; @@ -230,7 +230,7 @@ public class GlobalConfiguration extends ConfigurationPart { public BookSize bookSize; - + public class BookSize extends ConfigurationPart { - public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above + public int pageMax = !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize Default Configurations @@ -99,7 +99,7 @@ index 3bc7230ca62ebe3426da293e436a962bb0134f85..766e518c6a3b3e684f5fda65a680b537 + } + }}; + // Plazma end - + @ConfigSerializable public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) { @@ -308,7 +316,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -116,7 +116,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java @@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart { - + public class AntiXray extends ConfigurationPart { public boolean enabled = false; - public EngineMode engineMode = EngineMode.HIDE; @@ -135,17 +135,17 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f + // Plazma end } } - + @@ -120,8 +120,8 @@ public class WorldConfiguration extends ConfigurationPart { public ArmorStands armorStands; - + public class ArmorStands extends ConfigurationPart { - public boolean doCollisionEntityLookups = true; - public boolean tick = true; + public boolean doCollisionEntityLookups = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations + public boolean tick = Boolean.getBoolean("Plazma.disableConfigOptimization");; // Plazma - Optimize Default Configurations } - + public Markers markers; @@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart { @MergeMap @@ -153,7 +153,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f @MergeMap - public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance()))); + public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations - + @ConfigSerializable public record DespawnRange(@Required int soft, @Required int hard) { @@ -372,7 +372,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -176,9 +176,9 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f + public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations public boolean allowPlayerCrammingDamage = false; } - + @@ -462,18 +462,40 @@ public class WorldConfiguration extends ConfigurationPart { - + public class Chunks extends ConfigurationPart { public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); - public int maxAutoSaveChunksPerTick = 24; @@ -229,7 +229,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f } @@ -488,9 +510,9 @@ public class WorldConfiguration extends ConfigurationPart { public TickRates tickRates; - + public class TickRates extends ConfigurationPart { - public int grassSpread = 1; + public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations @@ -240,7 +240,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f public Table, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1)); } @@ -514,9 +536,9 @@ public class WorldConfiguration extends ConfigurationPart { - + public class Misc extends ConfigurationPart { public int lightQueueSize = 20; - public boolean updatePathfindingOnBlockUpdate = true; @@ -256,28 +256,28 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c --- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java +++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java @@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int { - + @Override protected int fallback() { + if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate; } - + diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4fcf8f86b 100644 +index 6f8b44bdf4d419b2bf0982dc209def53e4b4763c..c1ea9101bfc4c101c98ea14d1db71dcb95cb7ceb 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -166,7 +166,7 @@ public class Main { +@@ -167,7 +167,7 @@ public class Main { File configFile = (File) optionset.valueOf("bukkit-settings"); YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile); configuration.options().copyDefaults(true); - configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); + configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations configuration.save(configFile); - + File commandFile = (File) optionset.valueOf("commands-settings"); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index 1ea3012995c738c67b31e997c138f824f9e69ba1..aa37c7a7bfe75064db9cf78e967a6644f61b0e09 100644 +index 1ea3012995c738c67b31e997c138f824f9e69ba1..9683794c187dcafc1fbbde4c074cb86402467cb1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -120,7 +120,7 @@ public class DedicatedServerProperties extends Settings -Date: Thu, 5 Jan 2024 06:04:37 +0100 +Date: Fri, 5 Jan 2024 06:04:37 +0100 Subject: [PATCH] Validate ResourceLocation in NBT reading diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 18fad4f083862ace2bc56579883f548f6d697091..80083fed4b44b9d433925f09db83e559582109a1 100644 +index 7bc60901297d27d88efb401d02b4bc06d8b28874..f1b936bbef9a29d929646360df484fe24ade9780 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java @@ -230,8 +230,10 @@ public final class NbtUtils { @@ -22,10 +22,10 @@ index 18fad4f083862ace2bc56579883f548f6d697091..80083fed4b44b9d433925f09db83e559 return Blocks.AIR.defaultBlockState(); } else { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index e0cf7771488ab0065708d68b4e8550b865af0ed4..a7fbd329ea6d36a46c00b4476c74e426dbbfe238 100644 +index 699b166b6438cbe0cd197547df4d8dc4359e0b34..0d3ab6d59087da828698ae847929a31585f6796c 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -620,7 +620,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -644,7 +644,7 @@ public abstract class Mob extends LivingEntity implements Targeting { this.setLeftHanded(nbt.getBoolean("LeftHanded")); if (nbt.contains("DeathLootTable", 8)) { @@ -35,10 +35,10 @@ index e0cf7771488ab0065708d68b4e8550b865af0ed4..a7fbd329ea6d36a46c00b4476c74e426 } diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 42ebd91196ae420eee57f4380abc558555457163..b61a367048c3d6dfef187fef35a5dc7471f891d0 100644 +index 6b070ad6aa1b62a66fb85d54042af9d64cdcea7f..306e30541aeed280c23ddfc8ca87a2fc4ea10a55 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -560,7 +560,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -542,7 +542,7 @@ public abstract class AbstractArrow extends Projectile { this.setCritArrow(nbt.getBoolean("crit")); this.setPierceLevel(nbt.getByte("PierceLevel")); if (nbt.contains("SoundEvent", 8)) {