mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-04-02 04:27:25 +02:00
Use an immutable view in GeyserDefineCommandsEvent
Methods to properly register/unregister commands are provided in the command manager
This commit is contained in:
parent
36c49a7256
commit
b5eb27693f
2 changed files with 2 additions and 3 deletions
api/geyser/src/main/java/org/geysermc/geyser/api/event/lifecycle
core/src/main/java/org/geysermc/geyser/command
|
@ -36,8 +36,7 @@ import java.util.Map;
|
|||
* Called when commands are defined within Geyser.
|
||||
*
|
||||
* @param commandManager the command manager
|
||||
* @param commands a mutable list of the currently
|
||||
* registered default commands
|
||||
* @param commands an immutable view of the default commands
|
||||
*/
|
||||
public record GeyserDefineCommandsEvent(@NonNull CommandManager commandManager, @NonNull Map<String, Command> commands) implements Event {
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public abstract class GeyserCommandManager extends CommandManager {
|
|||
register(new StopCommand(geyser, "stop", "geyser.commands.stop.desc", "geyser.command.stop"));
|
||||
}
|
||||
|
||||
this.geyser.eventBus().fire(new GeyserDefineCommandsEvent(this, this.commands));
|
||||
this.geyser.eventBus().fire(new GeyserDefineCommandsEvent(this, this.commands()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue