From 03c3587e2e4750ae5777fbad54431a35743d7747 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 8 Jun 2023 19:45:48 -0700 Subject: [PATCH] fix not editable sign after openSign --- patches/server/0013-Paper-Plugins.patch | 4 ++-- .../0188-Add-openSign-method-to-HumanEntity.patch | 10 +++++----- test-plugin/build.gradle.kts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/server/0013-Paper-Plugins.patch b/patches/server/0013-Paper-Plugins.patch index e923cff3e2..263bebcb9a 100644 --- a/patches/server/0013-Paper-Plugins.patch +++ b/patches/server/0013-Paper-Plugins.patch @@ -5188,7 +5188,7 @@ index 0000000000000000000000000000000000000000..d1088e4b7fa5f8e689f23b150b83645c +} diff --git a/src/main/java/io/papermc/paper/plugin/provider/configuration/serializer/constraints/PluginConfigConstraints.java b/src/main/java/io/papermc/paper/plugin/provider/configuration/serializer/constraints/PluginConfigConstraints.java new file mode 100644 -index 0000000000000000000000000000000000000000..a0109a388188b0808900405d334a40318ab16ec1 +index 0000000000000000000000000000000000000000..2e02f73b857c530a0cce3a8d6aae46e3b0966486 --- /dev/null +++ b/src/main/java/io/papermc/paper/plugin/provider/configuration/serializer/constraints/PluginConfigConstraints.java @@ -0,0 +1,86 @@ @@ -5211,7 +5211,7 @@ index 0000000000000000000000000000000000000000..a0109a388188b0808900405d334a4031 +public final class PluginConfigConstraints { + + public static final Set RESERVED_KEYS = Set.of("bukkit", "minecraft", "mojang", "spigot", "paper"); -+ public static final Set VALID_PAPER_VERSIONS = Set.of("1.19"); ++ public static final Set VALID_PAPER_VERSIONS = Set.of("1.19", "1.20"); + + @Documented + @Retention(RetentionPolicy.RUNTIME) diff --git a/patches/server/0188-Add-openSign-method-to-HumanEntity.patch b/patches/server/0188-Add-openSign-method-to-HumanEntity.patch index 58af0de020..b91d3c8b72 100644 --- a/patches/server/0188-Add-openSign-method-to-HumanEntity.patch +++ b/patches/server/0188-Add-openSign-method-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..79d65cd38fea160cf8c3b4b8c32bb62740f18c9a 100644 +index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..78b57aa3120f8526b4bff2ca90d7735845a87b41 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -@@ -110,15 +110,15 @@ public class CraftSign extends CraftBlockEntityState< +@@ -110,7 +110,7 @@ public class CraftSign extends CraftBlockEntityState< super.applyTo(sign); } @@ -16,13 +16,13 @@ index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..79d65cd38fea160cf8c3b4b8c32bb627 + public static void openSign(Sign sign, org.bukkit.entity.HumanEntity player, Side side) { // Paper - change move open sign to HumanEntity Preconditions.checkArgument(sign != null, "sign == null"); Preconditions.checkArgument(side != null, "side == null"); -- Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); -+ // Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); // Paper - don't require placed - Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player"); + Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); +@@ -118,7 +118,8 @@ public class CraftSign extends CraftBlockEntityState< SignBlockEntity handle = ((CraftSign) sign).getTileEntity(); - ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side); ++ handle.setAllowedPlayerEditor(player.getUniqueId()); // Paper + ((org.bukkit.craftbukkit.entity.CraftHumanEntity) player).getHandle().openTextEdit(handle, Side.FRONT == side); // Paper - change move open sign to HumanEntity } diff --git a/test-plugin/build.gradle.kts b/test-plugin/build.gradle.kts index e86b933408..f280918aaa 100644 --- a/test-plugin/build.gradle.kts +++ b/test-plugin/build.gradle.kts @@ -10,7 +10,7 @@ tasks.processResources { .split(".", "-").take(2).joinToString(".") val props = mapOf( "version" to project.version, - "apiversion" to apiVersion, + "apiversion" to "\"$apiVersion\"", ) inputs.properties(props) filesMatching("paper-plugin.yml") {