Skip to content

Commit

Permalink
fix sign gui closing issue in 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
hakan-krgn committed Aug 10, 2023
1 parent f21c82e commit 3ef4edd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ private SignGui_v1_20_R1(@Nonnull Player player,
@Override
public SignGui open() {
Location location = super.player.getLocation();
BlockPosition blockPosition = new BlockPosition(location.getBlockX(), LOWEST_Y_AXIS + 1, location.getBlockZ());
BlockPosition blockPosition = new BlockPosition(location.getBlockX(), location.getBlockY() + 3, location.getBlockZ());
IBlockData data = CraftMagicNumbers.getBlock(super.type.asMaterial()).n();

HCore.sendPacket(super.player, new PacketPlayOutBlockChange(blockPosition, data));

TileEntitySign sign = new TileEntitySign(blockPosition, null);
SignText signText = sign.a(true);
for (int i = 0; i < lines.length; i++)
signText = signText.a(i, IChatBaseComponent.a(lines[i]));
for (int i = 0; i < super.lines.length; i++)
signText = signText.a(i, IChatBaseComponent.a(super.lines[i]));
sign.a(signText, true);
HCore.sendPacket(super.player, sign.j());

Expand Down

0 comments on commit 3ef4edd

Please sign in to comment.