2021-12-05 08:11:59 +01: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 openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
2023-06-08 15:25:35 +02:00
index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..79d65cd38fea160cf8c3b4b8c32bb62740f18c9a 100644
2021-12-05 08:11:59 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
2023-06-08 15:25:35 +02:00
@@ -110,15 +110,15 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
2023-06-01 01:36:57 +02:00
super.applyTo(sign);
2021-12-05 08:11:59 +01:00
}
2023-06-08 15:25:35 +02:00
- public static void openSign(Sign sign, Player player, Side side) {
+ public static void openSign(Sign sign, org.bukkit.entity.HumanEntity player, Side side) { // Paper - change move open sign to HumanEntity
2021-12-05 08:11:59 +01:00
Preconditions.checkArgument(sign != null, "sign == null");
2023-06-08 15:25:35 +02:00
Preconditions.checkArgument(side != null, "side == null");
2021-12-05 08:11:59 +01:00
- Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed");
+ // Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); // Paper - don't require placed
Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player");
2022-12-07 19:52:24 +01:00
SignBlockEntity handle = ((CraftSign<?>) sign).getTileEntity();
2021-12-05 08:11:59 +01:00
2023-06-08 15:25:35 +02:00
- ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side);
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity) player).getHandle().openTextEdit(handle, Side.FRONT == side); // Paper - change move open sign to HumanEntity
2021-12-05 08:11:59 +01:00
}
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
2023-06-08 21:35:20 +02:00
index c6b2f1b90735ec75492daf64031d9d33226cdac6..4f2a15ff2d4381765c608260c54494f6a11a66cf 100644
2021-12-05 08:11:59 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
2023-05-12 13:10:08 +02:00
@@ -628,6 +628,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
2021-12-05 08:11:59 +01:00
}
}
+ // Paper start - move open sign method to HumanEntity
+ @Override
2023-06-08 21:35:20 +02:00
+ public void openSign(final org.bukkit.block.Sign sign, final org.bukkit.block.sign.Side side) {
+ org.bukkit.craftbukkit.block.CraftSign.openSign(sign, this, side);
2021-12-05 08:11:59 +01:00
+ }
+ // Paper end
@Override
public boolean dropItem(boolean dropAll) {
if (!(this.getHandle() instanceof ServerPlayer)) return false;