mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 11:37:05 +01:00
Improve distance trigger performance
This commit is contained in:
parent
2dbceef81a
commit
2ac2a3c22b
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.trigger;
|
||||
|
||||
import de.erethon.dungeonsxl.api.sign.DungeonSign;
|
||||
import de.erethon.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import de.erethon.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -50,12 +51,16 @@ public class DistanceTrigger extends Trigger {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isTriggered()) {
|
||||
return;
|
||||
}
|
||||
setTriggered(true);
|
||||
this.setPlayer(player);
|
||||
setPlayer(player);
|
||||
updateDSigns();
|
||||
DGameWorld gameWorld = null;
|
||||
for (DungeonSign sign : getDSigns()) {
|
||||
gameWorld = (DGameWorld) sign.getGameWorld();
|
||||
removeDSign(sign);
|
||||
sign.removeTrigger(this);
|
||||
}
|
||||
unregister(gameWorld);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user