Paper/Spigot-Server-Patches/0248-Add-method-to-open-already-placed-sign.patch
Shane Freeder ccbeb5c4ed
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
6ffe5a68 Add RecipeChoice.ExactChoice API for NBT matches on ingredients
ffccf6b7 SPIGOT-4560: Add HumanEntity.sleep and related APIs

CraftBukkit Changes:
917411fd Remove redundant BlockPosition creation from sleep API
756c38d1 Add RecipeChoice.ExactChoice API for NBT matches on ingredients
8e65d8df SPIGOT-4560: Add HumanEntity.sleep and related APIs
a8382862 SPIGOT-4562: reducedDebugInfo not updated on world change
2019-01-02 18:10:14 +00:00

32 lines
1.3 KiB
Diff

From 95cec79483b836faea4891a9aff576091bf11136 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 af51b3def5..b82aa903ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -655,4 +655,17 @@ 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
}
--
2.20.1