mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
some review
This commit is contained in:
parent
ffb8256899
commit
6159799804
4 changed files with 8 additions and 13 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue