diff --git a/build.gradle.kts b/build.gradle.kts index 44390b4..f76d846 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false - id("io.papermc.paperweight.patcher") version "1.7.0" + id("io.papermc.paperweight.patcher") version "1.7.1" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" @@ -15,8 +15,8 @@ repositories { } dependencies { - remapper("net.fabricmc:tiny-remapper:0.10.1:fat") - decompiler("net.minecraftforge:forgeflower:2.0.674.2") + remapper("net.fabricmc:tiny-remapper:0.10.2:fat") + decompiler("org.vineflower:vineflower:1.10.1") paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT") } @@ -80,7 +80,6 @@ paperweight { tasks.generateDevelopmentBundle { apiCoordinates.set("me.totalfreedom.scissors:scissors-api") - mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi") libraryRepositories.set( listOf( "https://repo.maven.apache.org/maven2/", diff --git a/gradle.properties b/gradle.properties index 633e905..9973f6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.totalfreedom.scissors version=1.20.6-R0.1-SNAPSHOT mcVersion=1.20.6 -paperRef=6c02dbcfa137f40418fc56a0a85721b1fa0242ff +paperRef=79e2cb620ef03539390d97940824b38b707918f5 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index 42bd869..113ffe2 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -1,31 +1,25 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Telesphoreo -Date: Wed, 1 May 2024 15:37:34 -0500 +Date: Fri, 14 Jun 2024 17:38:20 -0500 Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index 5d448d8a7cf6626a11791f30ad52baf41a099272..119e105ffbb3143008e5a1953b11db161ceab9e2 100644 +index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..b0e9bf22d546110d995b5625ce8ed22501992679 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -12,8 +12,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { +@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { val alsoShade: Configuration by configurations.creating dependencies { - implementation(project(":paper-api")) -- implementation(project(":paper-mojangapi")) -+ // Scissors start -+ implementation(project(":Scissors-API")) -+ implementation("io.papermc.paper:paper-mojangapi:1.20.6-R0.1-SNAPSHOT") { -+ exclude("io.papermc.paper", "paper-api") -+ } -+ // Scissors end ++ implementation(project(":Scissors-API")) // Scissors // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -75,11 +79,19 @@ tasks.jar { +@@ -77,17 +77,25 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() - val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" + val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash" val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper - val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper + // Scissors start @@ -39,13 +33,22 @@ index 5d448d8a7cf6626a11791f30ad52baf41a099272..119e105ffbb3143008e5a1953b11db16 + // Scissors end attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", - "Implementation-Title" to "CraftBukkit", -- "Implementation-Version" to "git-Paper-$implementationVersion", -+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors + "Implementation-Title" to "Paper", + "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, // Paper - "Specification-Title" to "Bukkit", +- "Specification-Title" to "Paper", ++ "Specification-Title" to "Scissors", "Specification-Version" to project.version, -@@ -138,7 +150,7 @@ fun TaskContainer.registerRunTask( +- "Specification-Vendor" to "Paper Team", +- "Brand-Id" to "papermc:paper", +- "Brand-Name" to "Paper", ++ "Specification-Vendor" to "Scissors Team", ++ "Brand-Id" to "scissorsmc:scissors", ++ "Brand-Name" to "Scissors", + "Build-Number" to (build ?: ""), + "Build-Time" to Instant.now().toString(), + "Git-Branch" to gitBranch, // Paper +@@ -144,7 +152,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -55,7 +58,7 @@ index 5d448d8a7cf6626a11791f30ad52baf41a099272..119e105ffbb3143008e5a1953b11db16 standardInput = System.`in` workingDir = rootProject.layout.projectDirectory diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 100644 +index 4b002e8b75d117b726b0de274a76d3596fce015b..5ff11b9bcef76cb767f0b03ffc326d3f7a361371 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { @@ -63,7 +66,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d0 // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { - Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger()); -+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors ++ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -72,17 +75,17 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d0 if (implVersion != null) { final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1); - paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); -+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors ++ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); } else { paperVersion = "unknown"; } - metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion)); -+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors ++ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166947f7169 100644 +index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..2fbb5fc19e6d7f3767c7c6eedcbc6af2b0877ae5 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -90,36 +93,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166 protected LineReader buildReader(LineReaderBuilder builder) { builder - .appName("Paper") -+ .appName("Scissors") // Scissors ++ .appName("Scissors") .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..d4dbab7af2862df9a6e08600dba3c9796e18d4f3 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1924,7 +1924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Paper - } - - public SystemReport fillSystemReport(SystemReport details) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 05e304f9fc8d0291fa779da589bd060ef4165b49..a82a43bf61ad93b9c8415d4df4bacc44ed9e08ee 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -268,7 +268,7 @@ import javax.annotation.Nullable; // Paper - import javax.annotation.Nonnull; // Paper - - public final class CraftServer implements Server { -- private final String serverName = "Paper"; // Paper -+ private final String serverName = "Scissors"; // Scissors > // Paper - private final String serverVersion; - private final String bukkitVersion = Versioning.getBukkitVersion(); - private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/server/0003-ResourceLocation-validation.patch b/patches/server/0003-ResourceLocation-validation.patch index d4bf0e3..b4ed31e 100644 --- a/patches/server/0003-ResourceLocation-validation.patch +++ b/patches/server/0003-ResourceLocation-validation.patch @@ -1,97 +1,40 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Telesphoreo -Date: Sun, 5 May 2024 12:29:05 -0500 +Date: Fri, 14 Jun 2024 17:48:49 -0500 Subject: [PATCH] ResourceLocation validation -diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -index 183f31c81d9c0a966e6b20c2cff3d279dfc7e622..5d32a985894656712553a3f79abc454d6802d135 100644 ---- a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -@@ -20,7 +20,7 @@ public class PaperContainerEntityLootableInventory implements PaperLootableEntit +diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java +index 8b612b772ca87c852d0b108c2afd6785c261c9b9..e063562fdbe05882c4a81f9fb15141056c35ed8b 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -678,7 +678,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @Override - public org.bukkit.loot.LootTable getLootTable() { -- return entity.getLootTable() != null && !entity.getLootTable().location().getPath().isEmpty() ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; -+ return entity.getLootTable() != null && !entity.getLootTable().location().getPath().isEmpty() && entity.getLootTable().toString().length() < 256 ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; // Scissors - Validate length of loot tables before even trying - } - - @Override -diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -index 6f6e19b7b57cb3070ef5b6810d8449344705af8c..f364b0ca67c31ae2dfbdbf5eb7980e8ddf8b82f5 100644 ---- a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -@@ -17,7 +17,7 @@ public class PaperTileEntityLootableInventory implements PaperLootableBlockInven - - @Override - public org.bukkit.loot.LootTable getLootTable() { -- return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.location().getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; -+ return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.location().getPath().isEmpty() && tileEntityLootable.lootTable.toString().length() < 256 ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; // Scissors - Validate length of loot tables before even trying - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java -index c3215f15b3088199dcf96f62b58d0ec7c2b4125c..e290a8b5f790b8ad84c3e16f650afb731018fd4d 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java -@@ -1,5 +1,6 @@ - package org.bukkit.craftbukkit.block; - -+import net.minecraft.resources.ResourceLocation; - import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; - import org.bukkit.Location; - import org.bukkit.Nameable; -@@ -29,7 +30,13 @@ public abstract class CraftLootable - - @Override - public LootTable getLootTable() { -- return CraftLootTable.minecraftToBukkit(this.getSnapshot().lootTable); -+ // Scissors start - Return a null loot table if the specified loot table is not valid + public final ResourceKey getLootTable() { +- return this.lootTable == null ? this.getDefaultLootTable() : this.lootTable; + try { -+ return CraftLootTable.minecraftToBukkit(this.getSnapshot().lootTable); ++ return this.lootTable == null ? this.getDefaultLootTable() : this.lootTable; ++ } catch (Exception ex) { ++ return this.getDefaultLootTable(); ++ } + } + + protected ResourceKey getDefaultLootTable() { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +index 1f90f4b3f310b8cf5750c3a581be178f19b979d2..0c6aad363f99bd86393335b9df1e186a3198274f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +@@ -38,7 +38,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable { + } + + public static org.bukkit.loot.LootTable minecraftToBukkit(ResourceKey minecraft) { +- return (minecraft == null || minecraft.location().getPath().isEmpty()) ? null : Bukkit.getLootTable(CraftLootTable.minecraftToBukkitKey(minecraft)); // Paper - fix some NamespacedKey parsing ++ try { ++ return (minecraft == null || minecraft.location().getPath().isEmpty()) ? null : Bukkit.getLootTable(CraftLootTable.minecraftToBukkitKey(minecraft)); // Paper - fix some NamespacedKey parsing + } catch (Exception ex) { + return null; + } -+ // Scissors end } - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -index 4388cd0303b45faf21631e7644baebb63baaba10..3c049fe04c6a4166e6fd3a24de9209d806d1e33a 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -@@ -25,7 +25,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo - - @Override - public LootTable getLootTable() { -- return CraftLootTable.minecraftToBukkit(this.getHandle().lootTable); -+ // Scissors start - Return a null loot table if the specified loot table is not valid -+ try { -+ return CraftLootTable.minecraftToBukkit(this.getHandle().lootTable); -+ } catch (Exception exception) -+ { -+ return null; -+ } -+ // Scissors end - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index e155501fb3a88edf3ddac3aa0aae1b6a5a84962e..b588a3a39f2c003ddd1490decbce31f0b22bb2e1 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -78,7 +78,13 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - - @Override - public LootTable getLootTable() { -- return CraftLootTable.minecraftToBukkit(this.getHandle().getLootTable()); -+ // Scissors start - Return a null loot table if the specified loot table is not valid -+ try { -+ return CraftLootTable.minecraftToBukkit(this.getHandle().getLootTable()); -+ } catch (Exception exception) { -+ return null; -+ } -+ // Scissors end - } - - @Override + public static NamespacedKey minecraftToBukkitKey(ResourceKey minecraft) { diff --git a/patches/server/0005-Ignore-errors-thrown-when-trying-to-remove-minecart-.patch b/patches/server/0005-Ignore-errors-thrown-when-trying-to-remove-minecart-.patch index 013e3e1..bd53639 100644 --- a/patches/server/0005-Ignore-errors-thrown-when-trying-to-remove-minecart-.patch +++ b/patches/server/0005-Ignore-errors-thrown-when-trying-to-remove-minecart-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Ignore errors thrown when trying to remove minecart entities diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -index 2704389bc3ec6dbbf1b568a4380972f8c0d62d15..508275ec947826bc14b1671c2ae29d9804a811f2 100644 +index 9549eee0d92f322bd5232abd7e695213660c2e22..94a689e1adf24f6385dc97eb5cc3790c8e14da97 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -@@ -148,8 +148,14 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme +@@ -142,8 +142,14 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @Override public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { // CraftBukkit end diff --git a/patches/server/0007-Add-Scissors-configuration-file-command.patch b/patches/server/0007-Add-Scissors-configuration-file-command.patch index 25d9965..5ea9f62 100644 --- a/patches/server/0007-Add-Scissors-configuration-file-command.patch +++ b/patches/server/0007-Add-Scissors-configuration-file-command.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Telesphoreo -Date: Wed, 8 May 2024 11:59:08 -0500 +Date: Fri, 14 Jun 2024 17:56:03 -0500 Subject: [PATCH] Add Scissors configuration file & command @@ -184,10 +184,10 @@ index 0000000000000000000000000000000000000000..797677d892d83cf54d9a60af1e277b67 +} diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..2de0a3d68c3834b9834ab359c823195f8d90ceb2 +index 0000000000000000000000000000000000000000..1ada5b7778f03815455cac1a4aad4411d0cae053 --- /dev/null +++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java -@@ -0,0 +1,225 @@ +@@ -0,0 +1,224 @@ +package me.totalfreedom.scissors; + + @@ -272,7 +272,7 @@ index 0000000000000000000000000000000000000000..2de0a3d68c3834b9834ab359c823195f + } + + commands = new HashMap<>(); -+ commands.put("me/totalfreedom/scissors", new ScissorsCommand("me/totalfreedom/scissors")); ++ commands.put("scissors", new ScissorsCommand("scissors")); + + config.options().header(HEADER); + config.options().copyDefaults(true); @@ -412,9 +412,8 @@ index 0000000000000000000000000000000000000000..2de0a3d68c3834b9834ab359c823195f + return config.getString(path, config.getString(path)); + } +} -+ diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..1decf99fc2e6b332137eb240210f9f4a9be01085 100644 +index 244a19ecd0234fa1d7a6ecfea20751595688605d..fdc76373fd458884a45312c6edf2915a811910eb 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -133,6 +133,7 @@ public class Main { @@ -426,12 +425,12 @@ index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..1decf99fc2e6b332137eb240210f9f4a if (optionset.has("initSettings")) { // CraftBukkit diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..aef57b0054ceed16b0e2b733263049527ccafb1d 100644 +index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..0342ea47cb313e28027cb76e632a4d5b1565fc8d 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -235,6 +235,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -234,6 +234,16 @@ 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 - io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider + // Scissors start + try { @@ -447,10 +446,10 @@ index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..aef57b0054ceed16b0e2b73326304952 this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setMotd(dedicatedserverproperties.motd); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 180c16f303ae1aa2c2a9471b2c9cce70303668d4..57e82f87bc45b5c5c67aafe8fb4a0bb172c92270 100644 +index 5db08432b6afd3639688830e717f40ceaf599248..f2497d08157d3007d20be7ab333ab7c4f282c414 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1053,6 +1053,7 @@ public final class CraftServer implements Server { +@@ -1055,6 +1055,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot @@ -458,7 +457,7 @@ index 180c16f303ae1aa2c2a9471b2c9cce70303668d4..57e82f87bc45b5c5c67aafe8fb4a0bb1 this.console.paperConfigurations.reloadConfigs(this.console); for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty -@@ -1084,6 +1085,7 @@ public final class CraftServer implements Server { +@@ -1087,6 +1088,7 @@ public final class CraftServer implements Server { this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper @@ -466,7 +465,7 @@ index 180c16f303ae1aa2c2a9471b2c9cce70303668d4..57e82f87bc45b5c5c67aafe8fb4a0bb1 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -3048,6 +3050,14 @@ public final class CraftServer implements Server { +@@ -3053,6 +3055,14 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } @@ -482,10 +481,10 @@ index 180c16f303ae1aa2c2a9471b2c9cce70303668d4..57e82f87bc45b5c5c67aafe8fb4a0bb1 public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index c988afa496d25314451435eedd64079a0d87cef0..cd5c409cb0025c668c324e59fe191133981b2373 100644 +index b86ba59158964f73abd6622341a9acb98a33fa44..6101ff98022e7c1ad253edb112a0bf87b139e62b 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -168,6 +168,19 @@ public class Main { +@@ -169,6 +169,19 @@ public class Main { .defaultsTo(new File("paper.yml")) .describedAs("Yml file"); diff --git a/patches/server/0009-Better-handling-of-invalid-JSON-components.patch b/patches/server/0009-Better-handling-of-invalid-JSON-components.patch index b157d3c..7f341c3 100644 --- a/patches/server/0009-Better-handling-of-invalid-JSON-components.patch +++ b/patches/server/0009-Better-handling-of-invalid-JSON-components.patch @@ -62,10 +62,10 @@ index df26c39a2bb20e2021b50211dce905483a77f4e6..0b85d5aef65fdb08c1c11f0ebb973078 } }).reduce((accumulator, current) -> accumulator.append(component).append(current)).orElseGet(Component::empty); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2bc85351e6e52f90da5fdb29d8d042a06132d742..514c0a8842852bf73eac2e28e12834021164c93c 100644 +index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..6ee2d11e4f3fbc8424a2ffbe6a7ebd1832a25503 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2603,12 +2603,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2602,12 +2602,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setRot(this.getYRot(), this.getXRot()); if (nbt.contains("CustomName", 8)) { String s = nbt.getString("CustomName"); @@ -80,7 +80,7 @@ index 2bc85351e6e52f90da5fdb29d8d042a06132d742..514c0a8842852bf73eac2e28e1283402 this.setCustomNameVisible(nbt.getBoolean("CustomNameVisible")); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 6349f2e0a5ba30d250f5ffe43771f325c0999a76..ad6ba965da83cb328726f5f6e1d5df06015b7c42 100644 +index c0563260277f9f4bd9ff08993b2efb4bca9a0c60..f3c296f2464620083e44c14cc99eca1add8f8d9b 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -362,7 +362,7 @@ public abstract class BlockEntity { diff --git a/patches/server/0010-Prevent-attributes-with-invalid-namespaces-from-bein.patch b/patches/server/0010-Prevent-attributes-with-invalid-namespaces-from-bein.patch index 29182e1..3df2bb6 100644 --- a/patches/server/0010-Prevent-attributes-with-invalid-namespaces-from-bein.patch +++ b/patches/server/0010-Prevent-attributes-with-invalid-namespaces-from-bein.patch @@ -1,23 +1,23 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Telesphoreo -Date: Wed, 8 May 2024 12:26:49 -0500 +Date: Fri, 14 Jun 2024 18:00:35 -0500 Subject: [PATCH] Prevent attributes with invalid namespaces from being applied to CraftMetaItems diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 03f9fff7c06bf5f166d6277e3aa6adb5f646042d..1c48622db32bc99527bb551b5b71215b4eaf123c 100644 +index b6cd6897844aa9c8b9a94e41c56c4cfe4ac78780..34130c2cc3f643fcfe32a02747c45dd1eba05396 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -50,6 +50,7 @@ import net.minecraft.nbt.NbtIo; - import net.minecraft.nbt.NbtOps; +@@ -57,6 +57,7 @@ import net.minecraft.nbt.NbtOps; + import net.minecraft.nbt.SnbtPrinterTagVisitor; import net.minecraft.nbt.Tag; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.util.Unit; import net.minecraft.world.entity.EquipmentSlotGroup; -@@ -739,7 +740,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -764,7 +765,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { continue; } String attributeName = (String) obj;