diff options
author | Lulu13022002 <[email protected]> | 2024-09-21 21:19:02 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-21 21:19:02 +0200 |
commit | 1ed64f82704c299d0f7ae9af710579be995af8de (patch) | |
tree | 8de9a329fed8373ae5eccc59a9ee9558a53ee3fd /patches/server/0833-More-Sign-Block-API.patch | |
parent | 593faf4fc3ad433ef523672b6553124dd99f8ca3 (diff) | |
download | Paper-1ed64f82704c299d0f7ae9af710579be995af8de.tar.gz Paper-1ed64f82704c299d0f7ae9af710579be995af8de.zip |
Update launchProjectile API (#11300)
Diffstat (limited to 'patches/server/0833-More-Sign-Block-API.patch')
-rw-r--r-- | patches/server/0833-More-Sign-Block-API.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/patches/server/0833-More-Sign-Block-API.patch b/patches/server/0833-More-Sign-Block-API.patch new file mode 100644 index 0000000000..3be6f4e353 --- /dev/null +++ b/patches/server/0833-More-Sign-Block-API.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Fri, 23 Jun 2023 12:16:28 -0700 +Subject: [PATCH] More Sign Block API + +Co-authored-by: SoSeDiK <[email protected]> + +diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +index bfe8029852385875af4ebe73c63e688f61042021..3070cd2b588f5a69fd8c0d3551e16251680d8c27 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +@@ -68,12 +68,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C + } + + public boolean isFacingFrontText(net.minecraft.world.entity.player.Player player) { ++ // Paper start - More Sign Block API ++ return this.isFacingFrontText(player.getX(), player.getZ()); ++ } ++ public boolean isFacingFrontText(double x, double z) { ++ // Paper end - More Sign Block API + Block block = this.getBlockState().getBlock(); + + if (block instanceof SignBlock blocksign) { + Vec3 vec3d = blocksign.getSignHitboxCenterPosition(this.getBlockState()); +- double d0 = player.getX() - ((double) this.getBlockPos().getX() + vec3d.x); +- double d1 = player.getZ() - ((double) this.getBlockPos().getZ() + vec3d.z); ++ double d0 = x - ((double) this.getBlockPos().getX() + vec3d.x); // Paper - More Sign Block API ++ double d1 = z - ((double) this.getBlockPos().getZ() + vec3d.z); // Paper - More Sign Block API + float f = blocksign.getYRotationDegrees(this.getBlockState()); + float f1 = (float) (Mth.atan2(d1, d0) * 57.2957763671875D) - 90.0F; + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +index 8303343ecca91076839f4436d6b3a3bf4739c2fd..e3c333d26dea9af9dd51e1662f81f1d472ab0233 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +@@ -198,6 +198,26 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState< + } + // Paper end + ++ // Paper start - More Sign Block API ++ @Override ++ public java.util.UUID getAllowedEditorUniqueId() { ++ this.ensureNoWorldGeneration(); ++ return this.getTileEntity().getPlayerWhoMayEdit(); ++ } ++ ++ @Override ++ public void setAllowedEditorUniqueId(java.util.UUID uuid) { ++ this.ensureNoWorldGeneration(); ++ this.getTileEntity().setAllowedPlayerEditor(uuid); ++ } ++ ++ @Override ++ public Side getInteractableSideFor(final double x, final double z) { ++ this.requirePlaced(); ++ return this.getSnapshot().isFacingFrontText(x, z) ? Side.FRONT : Side.BACK; ++ } ++ // Paper end - More Sign Block API ++ + public static Component[] sanitizeLines(String[] lines) { + Component[] components = new Component[4]; + |