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 66 <parent >
77 <groupId >eu.endermite.commandwhitelist</groupId >
88 <artifactId >CommandWhitelist</artifactId >
9- <version >2.5.1 </version >
9+ <version >2.5.2 </version >
1010 </parent >
1111
1212 <artifactId >Bukkit</artifactId >
Original file line number Diff line number Diff line change 11package eu .endermite .commandwhitelist .bukkit .listeners ;
22
33import eu .endermite .commandwhitelist .bukkit .CommandWhitelistBukkit ;
4+ import eu .endermite .commandwhitelist .common .CWPermission ;
45import eu .endermite .commandwhitelist .common .CommandUtil ;
56import eu .endermite .commandwhitelist .common .ConfigCache ;
67import eu .endermite .commandwhitelist .common .commands .CWCommand ;
@@ -16,7 +17,7 @@ public class PlayerCommandPreProcessListener implements Listener {
1617 @ EventHandler (priority = EventPriority .HIGHEST )
1718 public void PlayerCommandSendEvent (org .bukkit .event .player .PlayerCommandPreprocessEvent event ) {
1819 Player player = event .getPlayer ();
19- if (player .hasPermission ("commandwhitelist.bypass" )) return ;
20+ if (player .hasPermission (CWPermission . BYPASS . permission () )) return ;
2021 String caseSensitiveLabel = CommandUtil .getCommandLabel (event .getMessage ());
2122 String label = caseSensitiveLabel .toLowerCase ();
2223 event .setMessage (event .getMessage ().replaceFirst (caseSensitiveLabel , label ));
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >eu.endermite.commandwhitelist</groupId >
88 <artifactId >CommandWhitelist</artifactId >
9- <version >2.5.1 </version >
9+ <version >2.5.2 </version >
1010 </parent >
1111
1212 <artifactId >Common</artifactId >
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >eu.endermite.commandwhitelist</groupId >
88 <artifactId >CommandWhitelist</artifactId >
9- <version >2.5.1 </version >
9+ <version >2.5.2 </version >
1010 </parent >
1111
1212 <artifactId >Velocity</artifactId >
Original file line number Diff line number Diff line change 1111import com .velocitypowered .api .proxy .ProxyServer ;
1212import eu .endermite .commandwhitelist .common .CWGroup ;
1313import eu .endermite .commandwhitelist .common .CWPermission ;
14+ import eu .endermite .commandwhitelist .common .CommandUtil ;
1415import eu .endermite .commandwhitelist .common .ConfigCache ;
1516import eu .endermite .commandwhitelist .common .commands .CWCommand ;
1617import eu .endermite .commandwhitelist .velocity .command .VelocityMainCommand ;
@@ -87,10 +88,12 @@ public void onUserCommandExecuteEvent(com.velocitypowered.api.event.command.Comm
8788
8889 if (player .hasPermission (CWPermission .BYPASS .permission ())) return ;
8990
91+ // Workaround for velocity executing "/ command" as valid command
92+ String command = event .getCommand ().trim ();
93+
9094 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 ))
9497 event .setResult (CommandExecuteEvent .CommandResult .forwardToServer ());
9598 }
9699
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >eu.endermite.commandwhitelist</groupId >
88 <artifactId >CommandWhitelist</artifactId >
9- <version >2.5.1 </version >
9+ <version >2.5.2 </version >
1010 </parent >
1111
1212 <artifactId >Waterfall</artifactId >
Original file line number Diff line number Diff line change 66
77 <groupId >eu.endermite.commandwhitelist</groupId >
88 <artifactId >CommandWhitelist</artifactId >
9- <version >2.5.1 </version >
9+ <version >2.5.2 </version >
1010 <modules >
1111 <module >CommandWhitelistCommon</module >
1212 <module >CommandWhitelistBukkit</module >
You can’t perform that action at this time.
0 commit comments