2018-08-27 02:11:49 +08:00
|
|
|
From 8a8d56752da4de54f7753a4c88c3a082b18638e8 Mon Sep 17 00:00:00 2001
|
2018-04-01 07:30:41 +08:00
|
|
|
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
|
|
|
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
|
2018-08-27 02:11:49 +08:00
|
|
|
index 38a886fbd5..92fe80316f 100644
|
2018-04-01 07:30:41 +08:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
2018-08-02 10:49:47 +08:00
|
|
|
@@ -518,4 +518,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
2018-04-01 07:30:41 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
--
|
2018-06-30 13:40:52 +08:00
|
|
|
2.18.0
|
2018-04-01 07:30:41 +08:00
|
|
|
|