Skip to content

Commit

Permalink
Added a workaround for hey0's getComplexBlock() returning a null when…
Browse files Browse the repository at this point in the history
… it should not.
  • Loading branch information
sk89q committed Oct 16, 2010
1 parent ed2859c commit 2634175
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SMServerInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public int getBlockData(Vector pt) {
public void setSignText(Vector pt, String[] text) {
Sign signData = (Sign)etc.getServer().getComplexBlock(
pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (signData == null) {
return;
}
for (byte i = 0; i < 4; i++) {
signData.setText(i, text[i]);
}
Expand All @@ -96,6 +99,9 @@ public void setSignText(Vector pt, String[] text) {
public String[] getSignText(Vector pt) {
Sign signData = (Sign)etc.getServer().getComplexBlock(
pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (signData == null) {
return new String[]{"", "", "", ""};
}
String[] text = new String[4];
for (byte i = 0; i < 4; i++) {
text[i] = signData.getText(i);
Expand Down

0 comments on commit 2634175

Please sign in to comment.