yaw null check

This commit is contained in:
Daniel Saukel 2019-06-16 06:09:33 +02:00
parent 209f8064de
commit 5a0723b145

View File

@ -52,9 +52,11 @@ public class TeleportSign extends LocationSign {
public void onInit() {
super.onInit();
for (int i = 1; i <= 2; i++) {
if (!lines[i].isEmpty()) {
int yaw = BlockUtil.lettersToYaw(lines[i]);
if (yaw != -1) {
if (lines[i].isEmpty()) {
continue;
}
Integer yaw = BlockUtil.lettersToYaw(lines[i]);
if (yaw != null) {
location.setYaw(yaw);
} else {
String[] loc = lines[i].split(",");
@ -73,7 +75,6 @@ public class TeleportSign extends LocationSign {
}
}
}
}
getSign().getBlock().setType(VanillaItem.AIR.getMaterial());
}