some review

This commit is contained in:
Konicai 2024-06-10 23:39:21 -05:00
parent ffb8256899
commit 6159799804
4 changed files with 8 additions and 13 deletions

View file

@ -77,8 +77,7 @@ public interface CommandSource {
* @return a GeyserConnection if this source represents a Bedrock player that is connected * @return a GeyserConnection if this source represents a Bedrock player that is connected
* to this Geyser instance, otherwise null * to this Geyser instance, otherwise null
*/ */
@Nullable @Nullable GeyserConnection connection();
GeyserConnection connection();
/** /**
* Returns the locale of the command source. * Returns the locale of the command source.

View file

@ -66,7 +66,6 @@ import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManage
import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.FileUtils; import org.geysermc.geyser.util.FileUtils;
import org.incendo.cloud.bukkit.BukkitCommandManager; import org.incendo.cloud.bukkit.BukkitCommandManager;
import org.incendo.cloud.bukkit.CloudBukkitCapabilities;
import org.incendo.cloud.execution.ExecutionCoordinator; import org.incendo.cloud.execution.ExecutionCoordinator;
import org.incendo.cloud.paper.LegacyPaperCommandManager; import org.incendo.cloud.paper.LegacyPaperCommandManager;
@ -172,7 +171,7 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
); );
LegacyPaperCommandManager<GeyserCommandSource> cloud; LegacyPaperCommandManager<GeyserCommandSource> cloud;
try { try {
// LegacyPaperCommandManager works for spigot too. todo: use PaperCommandManager instead for Paper 1.20.6+ // LegacyPaperCommandManager works for spigot too, see https://cloud.incendo.org/minecraft/paper
cloud = new LegacyPaperCommandManager<>( cloud = new LegacyPaperCommandManager<>(
this, this,
ExecutionCoordinator.simpleCoordinator(), ExecutionCoordinator.simpleCoordinator(),
@ -182,13 +181,12 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (cloud.hasCapability(CloudBukkitCapabilities.BRIGADIER)) { try {
try { // Commodore brigadier on Spigot/Paper 1.13 - 1.18.2
// Should always be available on 1.13 and up // Paper-only brigadier on 1.19+
cloud.registerBrigadier(); cloud.registerBrigadier();
} catch (BukkitCommandManager.BrigadierInitializationException e) { } catch (BukkitCommandManager.BrigadierInitializationException e) {
geyserLogger.debug("Failed to initialize Brigadier support: " + e.getMessage()); geyserLogger.debug("Failed to initialize Brigadier support: " + e.getMessage());
}
} }
this.commandRegistry = new SpigotCommandRegistry(geyser, cloud); this.commandRegistry = new SpigotCommandRegistry(geyser, cloud);

View file

@ -35,7 +35,6 @@ import java.util.Map;
* Permissions related to Geyser * Permissions related to Geyser
*/ */
public final class Permissions { public final class Permissions {
private static final Map<String, TriState> PERMISSIONS = new HashMap<>(); private static final Map<String, TriState> PERMISSIONS = new HashMap<>();
public static final String CHECK_UPDATE = register("geyser.update"); public static final String CHECK_UPDATE = register("geyser.update");

View file

@ -39,7 +39,6 @@ import java.util.Collections;
import java.util.List; import java.util.List;
public abstract class GeyserCommand implements org.geysermc.geyser.api.command.Command { public abstract class GeyserCommand implements org.geysermc.geyser.api.command.Command {
public static final String DEFAULT_ROOT_COMMAND = "geyser"; public static final String DEFAULT_ROOT_COMMAND = "geyser";
/** /**