2021-06-11 12:02:28 +00:00
|
|
|
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
|
2021-07-07 06:52:40 +00:00
|
|
|
index 54947f02f29dd3dc546ee0d0f4600630242f003d..f1b1d1881d0598503a7ec1022ef5e00f848fb247 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
2021-06-13 05:13:07 +00:00
|
|
|
@@ -610,6 +610,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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;
|
2021-06-12 19:30:37 +00:00
|
|
|
+ net.minecraft.world.level.block.entity.SignBlockEntity teSign = craftSign.getTileEntity();
|
2021-06-11 12:02:28 +00:00
|
|
|
+ // Make sign editable temporarily, will be set back to false in PlayerConnection later
|
|
|
|
+ teSign.isEditable = true;
|
2021-06-12 19:30:37 +00:00
|
|
|
+ this.getHandle().openTextEdit(teSign);
|
2021-06-11 12:02:28 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
@Override
|
|
|
|
public boolean dropItem(boolean dropAll) {
|
2021-07-07 06:52:40 +00:00
|
|
|
if (!(this.getHandle() instanceof ServerPlayer)) return false;
|