From 50f348988d525b94d99c7bd650fc2bc9779614a0 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 1 Apr 2018 02:30:41 +0300 Subject: [PATCH] Add method to open already placed sign --- ...d-method-to-open-already-placed-sign.patch | 25 ++++++++++++++++ ...d-method-to-open-already-placed-sign.patch | 29 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch create mode 100644 Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch diff --git a/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch new file mode 100644 index 0000000000..793360fec3 --- /dev/null +++ b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Vainomaa +Date: Sun, 1 Apr 2018 02:28:43 +0300 +Subject: [PATCH] Add method to open already placed sign + + +diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java +index 3939d4af..dd95773e 100644 +--- a/src/main/java/org/bukkit/entity/HumanEntity.java ++++ b/src/main/java/org/bukkit/entity/HumanEntity.java +@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv + */ + @Deprecated + public void setShoulderEntityRight(Entity entity); ++ ++ // Paper start - Add method to open already placed sign ++ /** ++ * Opens an editor window for the specified sign ++ * ++ * @param sign The sign to open ++ */ ++ void openSign(org.bukkit.block.Sign sign); ++ // Paper end + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch new file mode 100644 index 0000000000..b425e8db2b --- /dev/null +++ b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Vainomaa +Date: Sun, 1 Apr 2018 02:29:37 +0300 +Subject: [PATCH] Add method to open already placed sign + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +index a0128426f..d85b5defc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { + entity.remove(); + } + } ++ ++ // Paper start - Add method to open already placed sign ++ @Override ++ public void openSign(org.bukkit.block.Sign sign) { ++ org.apache.commons.lang.Validate.isTrue(sign.getWorld().equals(this.getWorld()), "Sign must be in the same world as player is in"); ++ org.bukkit.craftbukkit.block.CraftSign craftSign = (org.bukkit.craftbukkit.block.CraftSign) sign; ++ net.minecraft.server.TileEntitySign teSign = craftSign.getTileEntity(); ++ // Make sign editable temporarily, will be set back to false in PlayerConnection later ++ teSign.isEditable = true; ++ ++ getHandle().openSign(teSign); ++ } ++ // Paper end + } +-- \ No newline at end of file