Skip to content
This repository was archived by the owner on Aug 13, 2022. It is now read-only.

Commit d73cbe1

Browse files
committed
patched a problem
this update patches a problem causing the commands on exit to duplicate and run twice
1 parent 865fb28 commit d73cbe1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/handlers/CommandOnExitFlagHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public CommandOnExitFlagHandler create(Session session) {
3737

3838
protected CommandOnExitFlagHandler(Plugin plugin, Session session) {
3939
super(plugin, session);
40-
4140
this.lastCommands = new ArrayList<>();
4241
}
4342

@@ -60,15 +59,16 @@ public boolean onCrossBoundary(Player player, Location from, Location to, Applic
6059
}
6160

6261
for (Set<String> commands_ : this.lastCommands) {
63-
if (!commands.contains(commands_) && commands_.size() > 0) {
62+
if (!commands.contains(commands_)) {
6463
for (String command : commands_) {
65-
this.getPlugin().getServer().dispatchCommand(player, command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
64+
this.getPlugin().getServer().dispatchCommand(player,
65+
command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
6666
}
67+
break;
6768
}
6869
}
6970

7071
this.lastCommands = commands;
71-
7272
return true;
7373
}
7474
}

0 commit comments

Comments
 (0)