1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-22 16:29:25 +00:00

Begin tracking breaking changes

This commit is contained in:
onebeastchris
2025-10-28 01:13:32 +01:00
parent 5afde04826
commit d15180ce37
4 changed files with 11 additions and 22 deletions

6
BREAKING_CHANGES.md Normal file
View File

@@ -0,0 +1,6 @@
# Overview of breaking changes for THE MERGE
API
Functionality
- geyser root commands now always have a permission attached to them, which is granted by default

View File

@@ -134,7 +134,7 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
ExecutionCoordinator.simpleCoordinator(), ExecutionCoordinator.simpleCoordinator(),
sourceConverter sourceConverter
); );
this.commandRegistry = new CommandRegistry(geyser, cloud, false); // applying root permission would be a breaking change because we can't register permission defaults this.commandRegistry = new CommandRegistry(geyser, cloud);
// Big hack - Bungee does not provide us an event to listen to, so schedule a repeating // Big hack - Bungee does not provide us an event to listen to, so schedule a repeating
// task that waits for a field to be filled which is set after the plugin enable // task that waits for a field to be filled which is set after the plugin enable

View File

@@ -139,7 +139,7 @@ public class GeyserVelocityPlatform implements GeyserBootstrap, IsolatedPlatform
ExecutionCoordinator.simpleCoordinator(), ExecutionCoordinator.simpleCoordinator(),
sourceConverter sourceConverter
); );
this.commandRegistry = new CommandRegistry(geyser, cloud, false); // applying root permission would be a breaking change because we can't register permission defaults this.commandRegistry = new CommandRegistry(geyser, cloud);
} }
@Override @Override

View File

@@ -104,8 +104,6 @@ public class CommandRegistry implements EventRegistrar {
protected final GeyserImpl geyser; protected final GeyserImpl geyser;
private final CommandManager<GeyserCommandSource> cloud; private final CommandManager<GeyserCommandSource> cloud;
private final boolean applyRootPermission;
/** /**
* Map of Geyser subcommands to their Commands * Map of Geyser subcommands to their Commands
*/ */
@@ -126,28 +124,15 @@ public class CommandRegistry implements EventRegistrar {
*/ */
protected final Map<String, TriState> permissionDefaults = new Object2ObjectOpenHashMap<>(13); protected final Map<String, TriState> permissionDefaults = new Object2ObjectOpenHashMap<>(13);
/**
* Creates a new CommandRegistry. Does apply a root permission. If undesired, use the other constructor.
*/
public CommandRegistry(GeyserImpl geyser, CommandManager<GeyserCommandSource> cloud) {
this(geyser, cloud, true);
}
/** /**
* Creates a new CommandRegistry * Creates a new CommandRegistry
* *
* @param geyser the Geyser instance * @param geyser the Geyser instance
* @param cloud the cloud command manager to register commands to * @param cloud the cloud command manager to register commands to
* @param applyRootPermission true if this registry should apply a permission to Geyser and Extension root commands.
* This currently exists because we want to retain the root command permission for Spigot,
* but don't want to add it yet to platforms like Velocity where we cannot natively
* specify a permission default. Doing so will break setups as players would suddenly not
* have the required permission to execute any Geyser commands.
*/ */
public CommandRegistry(GeyserImpl geyser, CommandManager<GeyserCommandSource> cloud, boolean applyRootPermission) { public CommandRegistry(GeyserImpl geyser, CommandManager<GeyserCommandSource> cloud) {
this.geyser = geyser; this.geyser = geyser;
this.cloud = cloud; this.cloud = cloud;
this.applyRootPermission = applyRootPermission;
// register our custom exception handlers // register our custom exception handlers
ExceptionHandlers.register(cloud); ExceptionHandlers.register(cloud);
@@ -275,10 +260,8 @@ public class CommandRegistry implements EventRegistrar {
private void buildRootCommand(String permission, HelpCommand help) { private void buildRootCommand(String permission, HelpCommand help) {
Builder<GeyserCommandSource> builder = cloud.commandBuilder(help.rootCommand()); Builder<GeyserCommandSource> builder = cloud.commandBuilder(help.rootCommand());
if (applyRootPermission) {
builder = builder.permission(permission); builder = builder.permission(permission);
permissionDefaults.put(permission, TriState.TRUE); permissionDefaults.put(permission, TriState.TRUE);
}
cloud.command(builder.handler(context -> { cloud.command(builder.handler(context -> {
GeyserCommandSource source = context.sender(); GeyserCommandSource source = context.sender();