2020-07-30 20:10:15 +00:00
|
|
|
/*
|
2022-01-01 19:03:05 +00:00
|
|
|
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
|
2020-07-30 20:10:15 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* @author GeyserMC
|
|
|
|
* @link https://github.com/GeyserMC/Geyser
|
|
|
|
*/
|
|
|
|
|
2022-09-04 18:08:17 +00:00
|
|
|
package org.geysermc.geyser.api.event.lifecycle;
|
2019-12-21 17:35:48 +00:00
|
|
|
|
2022-01-16 21:09:53 +00:00
|
|
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
2022-09-04 18:08:17 +00:00
|
|
|
import org.geysermc.event.Event;
|
|
|
|
import org.geysermc.geyser.api.command.Command;
|
2022-01-16 21:09:53 +00:00
|
|
|
|
|
|
|
import java.util.Map;
|
2020-10-29 22:30:52 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-04 18:08:17 +00:00
|
|
|
* Called when commands are defined within Geyser.
|
|
|
|
*
|
|
|
|
* This event allows you to register new commands using the {@link #register(Command)}
|
|
|
|
* method and retrieve the default commands defined.
|
2020-10-29 22:30:52 +00:00
|
|
|
*/
|
2022-09-04 18:08:17 +00:00
|
|
|
public interface GeyserDefineCommandsEvent extends Event {
|
2019-12-21 17:35:48 +00:00
|
|
|
|
2020-10-29 22:30:52 +00:00
|
|
|
/**
|
2022-09-04 18:08:17 +00:00
|
|
|
* Registers the given {@link Command} into the Geyser
|
|
|
|
* command manager.
|
2022-01-16 21:09:53 +00:00
|
|
|
*
|
|
|
|
* @param command the command to register
|
2020-10-29 22:30:52 +00:00
|
|
|
*/
|
2022-09-04 18:08:17 +00:00
|
|
|
void register(@NonNull Command command);
|
2021-10-31 01:57:54 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-04 18:08:17 +00:00
|
|
|
* Gets all the registered built-in {@link Command}s.
|
2021-10-31 01:57:54 +00:00
|
|
|
*
|
2022-09-04 18:08:17 +00:00
|
|
|
* @return all the registered built-in commands
|
2021-10-31 01:57:54 +00:00
|
|
|
*/
|
2022-01-16 21:09:53 +00:00
|
|
|
@NonNull
|
2022-09-04 18:08:17 +00:00
|
|
|
Map<String, Command> commands();
|
2019-12-21 17:35:48 +00:00
|
|
|
}
|