Fix legacy ProgressTrigger references

This commit is contained in:
Daniel Saukel 2020-06-19 21:41:32 +02:00
parent 74a879212c
commit b35000358f
2 changed files with 7 additions and 8 deletions

View File

@ -29,8 +29,6 @@ import org.bukkit.Bukkit;
*/
public class ProgressTrigger extends Trigger {
private TriggerType type = TriggerTypeDefault.PROGRESS;
private DResourceWorld floor;
private int floorCount;
private int waveCount;
@ -102,7 +100,7 @@ public class ProgressTrigger extends Trigger {
@Override
public TriggerType getType() {
return type;
return TriggerTypeDefault.PRESENCE;
}
/* Statics */
@ -126,9 +124,11 @@ public class ProgressTrigger extends Trigger {
public static Set<ProgressTrigger> getByGameWorld(DGameWorld gameWorld) {
Set<ProgressTrigger> toReturn = new HashSet<>();
for (Trigger trigger : gameWorld.getTriggers(TriggerTypeDefault.PROGRESS)) {
for (Trigger trigger : gameWorld.getTriggers()) {
if (trigger instanceof ProgressTrigger) {
toReturn.add((ProgressTrigger) trigger);
}
}
return toReturn;
}

View File

@ -363,9 +363,8 @@ public class DGameWorld extends DInstanceWorld implements GameWorld {
continue;
}
for (de.erethon.dungeonsxl.api.Trigger apiTrigger : sign.getTriggers()) {
Trigger trigger = (Trigger) apiTrigger;
if (trigger.getType() == TriggerTypeDefault.PROGRESS) {
for (de.erethon.dungeonsxl.api.Trigger trigger : sign.getTriggers()) {
if (trigger instanceof ProgressTrigger) {
if (((ProgressTrigger) trigger).getFloorCount() > getGame().getFloorCount()) {
break signs;
}