File tree Expand file tree Collapse file tree 7 files changed +13
-9
lines changed
src/main/java/eu/endermite/commandwhitelist/bukkit/listeners
src/main/java/eu/endermite/commandwhitelist/velocity
CommandWhitelistWaterfall Expand file tree Collapse file tree 7 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >eu.endermite.commandwhitelist</groupId >
8
8
<artifactId >CommandWhitelist</artifactId >
9
- <version >2.5.1 </version >
9
+ <version >2.5.2 </version >
10
10
</parent >
11
11
12
12
<artifactId >Bukkit</artifactId >
Original file line number Diff line number Diff line change 1
1
package eu .endermite .commandwhitelist .bukkit .listeners ;
2
2
3
3
import eu .endermite .commandwhitelist .bukkit .CommandWhitelistBukkit ;
4
+ import eu .endermite .commandwhitelist .common .CWPermission ;
4
5
import eu .endermite .commandwhitelist .common .CommandUtil ;
5
6
import eu .endermite .commandwhitelist .common .ConfigCache ;
6
7
import eu .endermite .commandwhitelist .common .commands .CWCommand ;
@@ -16,7 +17,7 @@ public class PlayerCommandPreProcessListener implements Listener {
16
17
@ EventHandler (priority = EventPriority .HIGHEST )
17
18
public void PlayerCommandSendEvent (org .bukkit .event .player .PlayerCommandPreprocessEvent event ) {
18
19
Player player = event .getPlayer ();
19
- if (player .hasPermission ("commandwhitelist.bypass" )) return ;
20
+ if (player .hasPermission (CWPermission . BYPASS . permission () )) return ;
20
21
String caseSensitiveLabel = CommandUtil .getCommandLabel (event .getMessage ());
21
22
String label = caseSensitiveLabel .toLowerCase ();
22
23
event .setMessage (event .getMessage ().replaceFirst (caseSensitiveLabel , label ));
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >eu.endermite.commandwhitelist</groupId >
8
8
<artifactId >CommandWhitelist</artifactId >
9
- <version >2.5.1 </version >
9
+ <version >2.5.2 </version >
10
10
</parent >
11
11
12
12
<artifactId >Common</artifactId >
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >eu.endermite.commandwhitelist</groupId >
8
8
<artifactId >CommandWhitelist</artifactId >
9
- <version >2.5.1 </version >
9
+ <version >2.5.2 </version >
10
10
</parent >
11
11
12
12
<artifactId >Velocity</artifactId >
Original file line number Diff line number Diff line change 11
11
import com .velocitypowered .api .proxy .ProxyServer ;
12
12
import eu .endermite .commandwhitelist .common .CWGroup ;
13
13
import eu .endermite .commandwhitelist .common .CWPermission ;
14
+ import eu .endermite .commandwhitelist .common .CommandUtil ;
14
15
import eu .endermite .commandwhitelist .common .ConfigCache ;
15
16
import eu .endermite .commandwhitelist .common .commands .CWCommand ;
16
17
import eu .endermite .commandwhitelist .velocity .command .VelocityMainCommand ;
@@ -87,10 +88,12 @@ public void onUserCommandExecuteEvent(com.velocitypowered.api.event.command.Comm
87
88
88
89
if (player .hasPermission (CWPermission .BYPASS .permission ())) return ;
89
90
91
+ // Workaround for velocity executing "/ command" as valid command
92
+ String command = event .getCommand ().trim ();
93
+
90
94
HashSet <String > allowedCommands = CommandWhitelistVelocity .getCommands (player );
91
- String command = event .getCommand ().split (" " )[0 ];
92
- if (server .getCommandManager ().hasCommand (command )
93
- && !allowedCommands .contains (command ))
95
+ String label = CommandUtil .getCommandLabel (command );
96
+ if (server .getCommandManager ().hasCommand (label ) && !allowedCommands .contains (label ))
94
97
event .setResult (CommandExecuteEvent .CommandResult .forwardToServer ());
95
98
}
96
99
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >eu.endermite.commandwhitelist</groupId >
8
8
<artifactId >CommandWhitelist</artifactId >
9
- <version >2.5.1 </version >
9
+ <version >2.5.2 </version >
10
10
</parent >
11
11
12
12
<artifactId >Waterfall</artifactId >
Original file line number Diff line number Diff line change 6
6
7
7
<groupId >eu.endermite.commandwhitelist</groupId >
8
8
<artifactId >CommandWhitelist</artifactId >
9
- <version >2.5.1 </version >
9
+ <version >2.5.2 </version >
10
10
<modules >
11
11
<module >CommandWhitelistCommon</module >
12
12
<module >CommandWhitelistBukkit</module >
You can’t perform that action at this time.
0 commit comments