mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Add method to open already placed sign
This commit is contained in:
parent
a080350652
commit
50f348988d
2 changed files with 54 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
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
|
||||
}
|
||||
--
|
|
@ -0,0 +1,29 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
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
|
||||
}
|
||||
--
|
Loading…
Reference in a new issue