Fixed command-on-exit & console-command-on-exit executes on entry (also removed it from oping idk wth that was doing there)

This commit is contained in:
isokissa3 2017-07-24 09:49:54 +03:00
parent 0a15fa5dff
commit d58e90ffe5
4 changed files with 10 additions and 21 deletions

View file

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.goldtreeservers</groupId>
<artifactId>worldguardextraflags</artifactId>
<version>2.14.1</version>
<version>2.14.2</version>
<name>WorldGuardExtraFlags</name>
<build>
<finalName>WorldGuardExtraFlagsPlugin</finalName>

View file

@ -63,9 +63,9 @@ public class CommandOnExitFlag extends Handler
}
}
for(Set<String> commands_ : commands)
for(Set<String> commands_ : this.lastCommands)
{
if (!this.lastCommands.contains(commands_))
if (!commands.contains(commands_))
{
boolean isOp = player.isOp();

View file

@ -63,29 +63,18 @@ public class ConsoleCommandOnExitFlag extends Handler
}
}
boolean isOp = player.isOp();
try
for(Set<String> commands_ : this.lastCommands)
{
player.setOp(true);
for(Set<String> commands_ : commands)
if (!commands.contains(commands_))
{
if (!this.lastCommands.contains(commands_))
for(String command : commands_)
{
for(String command : commands_)
{
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(WorldGuardExtraFlagsPlugin.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
}
break;
WorldGuardExtraFlagsPlugin.getPlugin().getServer().dispatchCommand(WorldGuardExtraFlagsPlugin.getPlugin().getServer().getConsoleSender(), command.substring(1).replace("%username%", player.getName())); //TODO: Make this better
}
break;
}
}
finally
{
player.setOp(isOp);
}
this.lastCommands = commands;
}

View file

@ -1,5 +1,5 @@
name: WorldGuardExtraFlags
version: 2.14.1
version: 2.14.2
description: Adds more flags to worldguard to help manage your server easily!
author: isokissa3
website: https://goldtreevers.net