diff --git a/.gitmodules b/.gitmodules index 3d90d7d..b41eeef 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "submodules/AdvancedSlimePaper"] path = submodules/AdvancedSlimePaper url = https://github.com/InfernalSuite/AdvancedSlimePaper.git - branch = paper_upstream-fixes + branch = main diff --git a/gradle.properties b/gradle.properties index 0a01104..b55220d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.totalfreedom.scissors version=1.20.2-R0.1-SNAPSHOT mcVersion=1.20.2 -paperRef=c1ac98328c3b4dc2834497aae70020af7b3c7d04 +paperRef=1865625d958b94d82e0bd601d6d860318980c4c4 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-AdvancedSlimePaper-Server-Changes.patch b/patches/server/0001-AdvancedSlimePaper-Server-Changes.patch index 841911c..d76f623 100644 --- a/patches/server/0001-AdvancedSlimePaper-Server-Changes.patch +++ b/patches/server/0001-AdvancedSlimePaper-Server-Changes.patch @@ -1948,7 +1948,7 @@ index 7e8dc9e8f381abfdcce2746edc93122d623622d1..12aadf4c981cdb1a6405de99016f4b40 public FullChunkStatus status; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 97745f0bab8d82d397c6c2a5775aed92bca0a034..7a9373df55bdbd01eb30ac9c623561087bd6b43e 100644 +index 8f31413c939cc2b0454ad3d9a1b618dbae449d00..3d5d79e428a7b0f1aa7d0d3911e6d61b9537e8a0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -268,7 +268,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop return null; } -- ResourceLocation key = getSnapshot().lootTable; +- ResourceLocation key = this.getSnapshot().lootTable; - return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key)); + // Scissors start - Return a null loot table if the specified loot table is not valid + try { -+ ResourceLocation key = getSnapshot().lootTable; ++ ResourceLocation key = this.getSnapshot().lootTable; + return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key)); + } catch (Exception ex) { + return null; @@ -144,7 +144,7 @@ index 5b9ccbd767630abfee648a4653f33d8ac625bd0c..05830258ba0f7d19b1d86c0d8c85df8f @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf11cf046fb 100644 +index 313ee5c8737b2e57f9b5db6512c1871766b2ccd4..aa7fa17b9fb8519d8b57e27a5b422249b9b875d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java @@ -33,8 +33,14 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo @@ -165,7 +165,7 @@ index 0dd0ce9a9b3253e87eda12354249ec2fd2a33cf2..b6920f9432ca1736afbe775186fbbcf1 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 153e4c88c168097eb4a78650e7c9c120bec202a3..4d6af55197bb6933daac50fc638f9c23fe652f39 100644 +index b4e45d8e9851552f30c9c29d3d9671e1e9094c38..4e8e1a6b718d9ec8720efb648ab023e9e39f67e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -80,8 +80,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/server/0016-Add-Scissors-configuration-file-command.patch b/patches/server/0016-Add-Scissors-configuration-file-command.patch index f2a7c3d..b7996de 100644 --- a/patches/server/0016-Add-Scissors-configuration-file-command.patch +++ b/patches/server/0016-Add-Scissors-configuration-file-command.patch @@ -426,7 +426,7 @@ index ec268189b19b6fa5c4521f96ce211a531db35ec5..343cb72710ef100cf7e4de1e081cfdc2 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 dbccbcb9b44e4efacdf53c2d161115cc20b36cff..c3eb9eef724fa04ede965c5875b948c829fafb5d 100644 +index 2b5d82fbf4e7ec32d0c53dd3e8207b1dba708bbd..84102c09874e6fc070050fb8b89b99fb28578af0 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -447,13 +447,13 @@ index dbccbcb9b44e4efacdf53c2d161115cc20b36cff..c3eb9eef724fa04ede965c5875b948c8 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 f7c3b65e0d6c76189aea00232b33722c4363d7dd..8b872a406752a72d49ff029e2586d4ac17d7be1f 100644 +index 2c3dbeb929c9ec110aee390299f13006f0a4ec66..3708b9c68300694a377001fa17b87d6cf5c59779 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1038,6 +1038,7 @@ public final class CraftServer implements Server { } - org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot + org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot + me.totalfreedom.scissors.ScissorsConfig.init(((File) console.options.valueOf("scissors-settings"))); // Scissors this.console.paperConfigurations.reloadConfigs(this.console); for (ServerLevel world : this.console.getAllLevels()) { @@ -466,7 +466,7 @@ index f7c3b65e0d6c76189aea00232b33722c4363d7dd..8b872a406752a72d49ff029e2586d4ac this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2914,6 +2916,14 @@ public final class CraftServer implements Server { +@@ -2915,6 +2917,14 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } @@ -482,7 +482,7 @@ index f7c3b65e0d6c76189aea00232b33722c4363d7dd..8b872a406752a72d49ff029e2586d4ac 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 ebec18e919885f9220693a8a419d239e8cddd567..544698c044d9eef57abccfbd41cbfdd6873e4f55 100644 +index 9838e5cb3da6b668653378cb2f5f620de1c2aaba..0ca722589a7e6fe83174c0c3e6aa31b841232efe 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -180,6 +180,20 @@ public class Main { diff --git a/patches/server/0017-Prevent-attributes-with-invalid-namespaces-from-bein.patch b/patches/server/0017-Prevent-attributes-with-invalid-namespaces-from-bein.patch index 5cf9b5b..ffa7156 100644 --- a/patches/server/0017-Prevent-attributes-with-invalid-namespaces-from-bein.patch +++ b/patches/server/0017-Prevent-attributes-with-invalid-namespaces-from-bein.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent attributes with invalid namespaces from being applied diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 5bd581c1a82236359c810037333590d0d9741587..35d640654ec483b98eeddb4887107a07f93f57aa 100644 +index ed6e5060901c348c4f56a573c23e2000d8f2fb72..5cdf1e6fcdc9e2bd821f40ec9bf95cf03f03179a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -46,6 +46,7 @@ import net.minecraft.nbt.NbtIo; @@ -20,7 +20,7 @@ index 5bd581c1a82236359c810037333590d0d9741587..35d640654ec483b98eeddb4887107a07 @@ -487,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier); - String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(ATTRIBUTES_IDENTIFIER.NBT)); // Paper + String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper - if (attributeName == null || attributeName.isEmpty()) { + if (attributeName == null || attributeName.isEmpty() || attributeName.length() > 256 || !ResourceLocation.isValidResourceLocation(attributeName)) { // Scissors continue; diff --git a/submodules/AdvancedSlimePaper b/submodules/AdvancedSlimePaper index dcbbf98..0ecbd01 160000 --- a/submodules/AdvancedSlimePaper +++ b/submodules/AdvancedSlimePaper @@ -1 +1 @@ -Subproject commit dcbbf985e0796b8ae96c22dedd18ee393b8e9a04 +Subproject commit 0ecbd018a033ddd98c3cd60fd094965db8a3774c