Some more Checks

This commit is contained in:
Sn0wStorm 2013-06-04 14:18:34 +02:00
parent 8baac3202c
commit 800e97adc1
4 changed files with 22 additions and 8 deletions

View File

@ -34,15 +34,23 @@ public class SIGNMob extends DSign {
@Override @Override
public boolean check() { public boolean check() {
// TODO Auto-generated method stub String lines[] = sign.getLines();
if (!lines[1].equals("") && !lines[2].equals("")) {
if (lines[1] != null) {
String[] atributes = lines[2].split(",");
if (atributes.length == 2) {
return true; return true;
} }
}
}
return false;
}
@Override @Override
public void onInit() { public void onInit() {
String lines[] = sign.getLines(); String lines[] = sign.getLines();
if (lines[1] != "" && lines[2] != "") { if (!lines[1].equals("") && !lines[2].equals("")) {
String mob = lines[1]; String mob = lines[1];
if (mob != null) { if (mob != null) {
String[] atributes = lines[2].split(","); String[] atributes = lines[2].split(",");

View File

@ -23,7 +23,9 @@ public class SIGNMsg extends DSign {
@Override @Override
public boolean check() { public boolean check() {
// TODO Auto-generated method stub if (sign.getLine(1).equals("")) {
return false;
}
return true; return true;
} }
@ -32,7 +34,7 @@ public class SIGNMsg extends DSign {
public void onInit() { public void onInit() {
String lines[] = sign.getLines(); String lines[] = sign.getLines();
if (lines[1] != "" && lines[2] != "") { if (!lines[1].equals("")) {
String msg = gworld.config.getMsg(p.parseInt(lines[1]), true); String msg = gworld.config.getMsg(p.parseInt(lines[1]), true);
if (msg != null) { if (msg != null) {
this.msg = msg; this.msg = msg;

View File

@ -17,7 +17,9 @@ public class SIGNPlace extends DSign {
@Override @Override
public boolean check() { public boolean check() {
// TODO Auto-generated method stub if (sign.getLine(1).equals("")) {
return false;
}
return true; return true;
} }

View File

@ -28,7 +28,9 @@ public class SIGNSoundMsg extends DSign {
@Override @Override
public boolean check() { public boolean check() {
// TODO Auto-generated method stub if (sign.getLine(1).equals("")) {
return false;
}
return true; return true;
} }
@ -37,7 +39,7 @@ public class SIGNSoundMsg extends DSign {
public void onInit() { public void onInit() {
String lines[] = sign.getLines(); String lines[] = sign.getLines();
if (lines[1] != "" && lines[2] != "") { if (!lines[1].equals("")) {
String msg = gworld.config.getMsg(p.parseInt(lines[1]), true); String msg = gworld.config.getMsg(p.parseInt(lines[1]), true);
if (msg != null) { if (msg != null) {
this.msg = msg; this.msg = msg;