-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84d0ea7
commit 2edde6c
Showing
2 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
api/src/main/java/net/md_5/bungee/api/event/ProxyDefineCommandsEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.md_5.bungee.api.event; | ||
|
||
import java.util.Collection; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.ToString; | ||
import net.md_5.bungee.api.connection.Connection; | ||
import net.md_5.bungee.api.plugin.Command; | ||
|
||
/** | ||
* Called when the proxy intercepts the Commands packet, allowing plugins to | ||
* hide commands that clients have permission for without disabling them. | ||
*/ | ||
@Data | ||
@ToString(callSuper = true) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class ProxyDefineCommandsEvent extends TargetedEvent | ||
{ | ||
/** | ||
* The commands to send to the player | ||
*/ | ||
private final Map<String, Command> commands; | ||
|
||
public ProxyDefineCommandsEvent(Connection sender, Connection receiver, Collection<Map.Entry<String, Command>> commands) | ||
{ | ||
super( sender, receiver ); | ||
this.commands = new HashMap<>( commands.size() ); | ||
for ( Map.Entry<String, Command> command : commands ) | ||
{ | ||
this.commands.put( command.getKey(), command.getValue() ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters