fix not editable sign after openSign

This commit is contained in:
Jake Potrebic 2023-06-08 19:45:48 -07:00
parent ccb194bbbb
commit 03c3587e2e
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
3 changed files with 8 additions and 8 deletions

View File

@ -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 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 new file mode 100644
index 0000000000000000000000000000000000000000..a0109a388188b0808900405d334a40318ab16ec1 index 0000000000000000000000000000000000000000..2e02f73b857c530a0cce3a8d6aae46e3b0966486
--- /dev/null --- /dev/null
+++ b/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
@@ -0,0 +1,86 @@ @@ -0,0 +1,86 @@
@ -5211,7 +5211,7 @@ index 0000000000000000000000000000000000000000..a0109a388188b0808900405d334a4031
+public final class PluginConfigConstraints { +public final class PluginConfigConstraints {
+ +
+ public static final Set<String> RESERVED_KEYS = Set.of("bukkit", "minecraft", "mojang", "spigot", "paper"); + public static final Set<String> RESERVED_KEYS = Set.of("bukkit", "minecraft", "mojang", "spigot", "paper");
+ public static final Set<String> VALID_PAPER_VERSIONS = Set.of("1.19"); + public static final Set<String> VALID_PAPER_VERSIONS = Set.of("1.19", "1.20");
+ +
+ @Documented + @Documented
+ @Retention(RetentionPolicy.RUNTIME) + @Retention(RetentionPolicy.RUNTIME)

View File

@ -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 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 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/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<T extends SignBlockEntity> extends CraftBlockEntityState< @@ -110,7 +110,7 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
super.applyTo(sign); 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 + 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(sign != null, "sign == null");
Preconditions.checkArgument(side != null, "side == null"); Preconditions.checkArgument(side != null, "side == null");
- Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed");
+ // Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); // Paper - don't require placed @@ -118,7 +118,8 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player");
SignBlockEntity handle = ((CraftSign<?>) sign).getTileEntity(); SignBlockEntity handle = ((CraftSign<?>) sign).getTileEntity();
- ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side); - ((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 + ((org.bukkit.craftbukkit.entity.CraftHumanEntity) player).getHandle().openTextEdit(handle, Side.FRONT == side); // Paper - change move open sign to HumanEntity
} }

View File

@ -10,7 +10,7 @@ tasks.processResources {
.split(".", "-").take(2).joinToString(".") .split(".", "-").take(2).joinToString(".")
val props = mapOf( val props = mapOf(
"version" to project.version, "version" to project.version,
"apiversion" to apiVersion, "apiversion" to "\"$apiVersion\"",
) )
inputs.properties(props) inputs.properties(props)
filesMatching("paper-plugin.yml") { filesMatching("paper-plugin.yml") {