Fix/improve handling of two exceptions
This commit is contained in:
parent
d9df6989ff
commit
e8f8317d52
|
@ -486,12 +486,16 @@ public class Plugin implements ServerEventListener {
|
|||
|
||||
private void checkPausedByPlayerCountSoon() {
|
||||
// check is done a second later to make sure the player has actually joined/left and is no longer on the list
|
||||
daemonTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
checkPausedByPlayerCount();
|
||||
}
|
||||
}, 1000);
|
||||
try {
|
||||
daemonTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
checkPausedByPlayerCount();
|
||||
}
|
||||
}, 1000);
|
||||
} catch (IllegalStateException ex) { // Timer is cancelled for some reason
|
||||
Logger.global.logWarning("Timer is already cancelled, skipping player-limit checks!");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkPausedByPlayerCount() {
|
||||
|
|
|
@ -28,6 +28,10 @@ public class LowresTile {
|
|||
this.size = tileSize.add(1, 1); // add 1 for seamless edges
|
||||
this.texture = ImageIO.read(in);
|
||||
|
||||
if (this.texture == null) {
|
||||
throw new IOException("No registered ImageReader is able to read the image-stream");
|
||||
}
|
||||
|
||||
if (this.texture.getWidth() != this.size.getX() || this.texture.getHeight() != this.size.getY() * 2) {
|
||||
throw new IOException("Size of tile does not match");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue