Better implementation of isWorldFinished() check

This commit is contained in:
Daniel Saukel 2020-04-07 02:22:04 +02:00
parent 49f65fcf2e
commit 4e7ccef5be
2 changed files with 3 additions and 1 deletions

View File

@ -42,6 +42,7 @@ public abstract class AbstractDSign implements DungeonSign {
private Sign sign;
private String[] lines;
private InstanceWorld instance;
String worldName;
private Set<Trigger> triggers = new HashSet<>();
private boolean initialized;
private boolean erroneous;
@ -51,6 +52,7 @@ public abstract class AbstractDSign implements DungeonSign {
this.sign = sign;
this.lines = lines;
this.instance = instance;
worldName = instance.getWorld().getName();
}
@Override

View File

@ -190,7 +190,7 @@ public abstract class Windup extends Deactivatable {
* @return if the world is already finished
*/
public boolean isWorldFinished() {
return api.getGameWorld(getSign().getWorld()) != null;
return Bukkit.getWorld(worldName) == null;
}
}