mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Moved the APIs to a dedicated repo
They can now be found at https://github.com/GeyserMC/api
This commit is contained in:
parent
7905581ec4
commit
3ac931e11b
46 changed files with 33 additions and 3036 deletions
|
@ -7,8 +7,8 @@ plugins {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
api(projects.geyserApi)
|
||||
api(projects.common)
|
||||
api(libs.geyser.api)
|
||||
|
||||
// Jackson JSON and YAML serialization
|
||||
api(libs.bundles.jackson)
|
||||
|
|
|
@ -46,7 +46,7 @@ import lombok.ToString;
|
|||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.api.event.downstream.ServerDefineCommandsEvent;
|
||||
import org.geysermc.geyser.api.event.java.ServerDefineCommandsEvent;
|
||||
import org.geysermc.geyser.command.GeyserCommandManager;
|
||||
import org.geysermc.geyser.inventory.item.Enchantment;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
|
@ -150,12 +150,20 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
|
|||
index -> new HashSet<>()).add(node.getName().toLowerCase());
|
||||
}
|
||||
|
||||
ServerDefineCommandsEvent event = new ServerDefineCommandsEvent(session, commands.keySet());
|
||||
session.getGeyser().eventBus().fire(event);
|
||||
var eventBus = session.getGeyser().eventBus();
|
||||
|
||||
var event = new ServerDefineCommandsEvent(session, commands.keySet());
|
||||
eventBus.fire(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oldEvent = new org.geysermc.geyser.api.event.downstream.ServerDefineCommandsEvent(session, commands.keySet());
|
||||
eventBus.fire(oldEvent);
|
||||
if (oldEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The command flags, not sure what these do apart from break things
|
||||
List<CommandData.Flag> flags = Collections.emptyList();
|
||||
|
||||
|
@ -258,7 +266,10 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
|
|||
/**
|
||||
* Stores the command description and parameter data for best optimizing the Bedrock commands packet.
|
||||
*/
|
||||
private record BedrockCommandInfo(String name, String description, CommandParamData[][] paramData) implements ServerDefineCommandsEvent.CommandInfo {
|
||||
private record BedrockCommandInfo(String name, String description, CommandParamData[][] paramData) implements
|
||||
org.geysermc.geyser.api.event.downstream.ServerDefineCommandsEvent.CommandInfo,
|
||||
ServerDefineCommandsEvent.CommandInfo
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue