From 263417550befb76617f0f6adad6106a46ab7048d Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 16 Oct 2010 16:45:31 -0700 Subject: [PATCH] Added a workaround for hey0's getComplexBlock() returning a null when it should not. --- src/SMServerInterface.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SMServerInterface.java b/src/SMServerInterface.java index af3a9fda9..50276b7c0 100644 --- a/src/SMServerInterface.java +++ b/src/SMServerInterface.java @@ -81,6 +81,9 @@ public class SMServerInterface implements ServerInterface { 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]); } @@ -96,6 +99,9 @@ public class SMServerInterface implements ServerInterface { 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);