Skip to content

Commit

Permalink
Properly read isFrontText in sign edit wrappers
Browse files Browse the repository at this point in the history
Fixes #656

WrapperPlayServerOpenSignEditor and WrapperPlayClientUpdateSign
break editing the back of signs by simply calling the wrapper. The
initializers for these isFrontText fields to "true" ran AFTER the
wrappers' superclass constructor, which means that the initializers
would overwrite the value set by the "read" method.
  • Loading branch information
joshuaprince committed Jan 17, 2024
1 parent 36b7375 commit 7b800a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public class WrapperPlayClientUpdateSign extends PacketWrapper<WrapperPlayClientUpdateSign> {
private Vector3i blockPosition;
private String[] textLines;
private boolean isFrontText = true;
private boolean isFrontText;

public WrapperPlayClientUpdateSign(PacketReceiveEvent event) {
super(event);
Expand All @@ -55,6 +55,8 @@ public void read() {
}
if (serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20)) {
isFrontText = readBoolean();
} else {
isFrontText = true;
}
textLines = new String[4];
for (int i = 0; i < 4; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

public class WrapperPlayServerOpenSignEditor extends PacketWrapper<WrapperPlayServerOpenSignEditor> {
private Vector3i position;
private boolean isFrontText = true;
private boolean isFrontText;

public WrapperPlayServerOpenSignEditor(PacketSendEvent event) {
super(event);
Expand All @@ -50,6 +50,8 @@ public void read() {
}
if (serverVersion.isNewerThanOrEquals(ServerVersion.V_1_20)) {
isFrontText = readBoolean();
} else {
isFrontText = true;
}
}

Expand Down

0 comments on commit 7b800a9

Please sign in to comment.