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-05-12 13:10:08 +02:00
|
|
|
index 9fd6a05fb8022c5e4e3d67f9b0e9df3f477ea637..32592483dfb477501a72360b6b9bc497a608ce0a 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
|
2022-12-07 19:52:24 +01:00
|
|
|
@@ -117,15 +117,15 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
|
2021-12-05 08:11:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- public static void openSign(Sign sign, Player player) {
|
|
|
|
+ public static void openSign(Sign sign, org.bukkit.entity.HumanEntity player) { // Paper - change move open sign to HumanEntity
|
|
|
|
Preconditions.checkArgument(sign != null, "sign == null");
|
|
|
|
- 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
|
|
|
handle.isEditable = true;
|
|
|
|
|
|
|
|
- ((CraftPlayer) player).getHandle().openTextEdit(handle);
|
|
|
|
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity) player).getHandle().openTextEdit(handle); // Paper - change move open sign to HumanEntity
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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-05-12 13:10:08 +02:00
|
|
|
index 03a05d4d34181b34ca67bdbd6c66006071bdcdb4..04fe1bd9254b084eacbbca0e2a8a1ac100d17f12 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
|
|
|
|
+ public void openSign(org.bukkit.block.Sign sign) {
|
|
|
|
+ org.bukkit.craftbukkit.block.CraftSign.openSign(sign, this);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
@Override
|
|
|
|
public boolean dropItem(boolean dropAll) {
|
|
|
|
if (!(this.getHandle() instanceof ServerPlayer)) return false;
|