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-07 21:54:11 +02:00
|
|
|
index 1a49daed4fe43d4513561e03937374c312d09efb..97028a14830384f06f4f1de36abfbc6bc1b90a19 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-07 21:54:11 +02:00
|
|
|
@@ -110,14 +110,14 @@ 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
|
|
|
}
|
|
|
|
|
|
|
|
- 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
|
|
|
|
2023-06-07 21:54:11 +02:00
|
|
|
- ((CraftPlayer) player).getHandle().openTextEdit(handle, true);
|
|
|
|
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity) player).getHandle().openTextEdit(handle, true); // 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-07 21:54:11 +02:00
|
|
|
index c6b2f1b90735ec75492daf64031d9d33226cdac6..db27f88cc2fcb2835a5ef03519c75a176426b9fa 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;
|