Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud for commands #3808

Merged
merged 129 commits into from
Jul 12, 2024
Merged

Cloud for commands #3808

merged 129 commits into from
Jul 12, 2024

Conversation

Konicai
Copy link
Member

@Konicai Konicai commented Jun 2, 2023

changes

  • GeyserCommandManager has been renamed to CommandRegistry

  • GeyserCommandExecutor and all subclasses have been removed in favour of Cloud.

  • WorldManager#hasPermission has been removed in favour of Cloud.

  • permission node for the root command of Geyser and extensions, that is required to use any child commands

  • Spigot

    • no longer depends on paper mojang api.
    • GeyserBrigadierSupport has been removed in favour of Cloud.
    • GeyserPaperCommandListener has been removed - cloud (and the way i designed permission checks) handles what it did.
  • Standalone/ViaProxy:

    • permissions.yml has been added, a list of default permissions available to all players.
  • Velocity/BungeeCord/Fabric/Standalone: commands are now registered before GeyserPostInitializeEvent, for consistency with Spigot, and to allow valid registration on Fabric.

    • There is still inconsistency between bootstraps on whether or not commands are re-registered whenever a reload occurs.

api changes:

deprecations

  • Command#isSuggestedOpOnly and the relevant builder method have been deprecated for removal
  • Command#subCommands has been deprecated for removal and will always return Collections.emptyList()
  • Command#isExecutableOnConsole() has been deprecated & replaced with #isPlayerOnly()

changes

  • Command#aliases() now always returns an immutable list

additions

  • Command.Builder#permission(String, Tristate) - register the permission and its default value to the server implementation if possible.
  • CommandSource#playerUuid - return a uuid if the source represents a player.
  • CommandSource#connection - return a Connection if the source represents a bedrock player managed by the current Geyser instance.

  • GeyserRegisterPermissionCheckersEvent - only used by Geyser-Standalone/ViaProxy. Fired when the command manager is created. Allows registering PermissionCheckers to the manager. Event listeners with a higher listener priority will register PermissionCheckers as having a higher priority.
  • PermissionChecker - api interface that is responsible for resolving a CommandSource and a permission node to a Tristate.

  • GeyserRegisterPermissionsEvent - fired by a server platform, or extension, or anything, when it is the proper time for permissions to be registered to the event caller. This event will be called by Geyser-Spigot/Standalone/Forge. An extension may also fire the event in order to register permissions to LuckPerms for Geyser-Velocity/BungeeCord/Fabric. Geyser's CommandRegistry will listen for this event, but api users may as well.

future and separate PRs

  • implementations of CommandSource#sendMessage are wildly different in terms of what kind of text format is passed to it. maybe an earlier PR.
  • use cloud's brigadier mappings to get suggestions on geyser standalone
  • add tab completion to geyser standalone JLine
  • revisit Command.Builder#permisssion(String, TriState)
  • geyser.command.exthelp.<id> can be changed to something better during The Merge

todo:

  • the lack of permissions on standalone. what this causes needs to be cleaned up, at least in extension commands.
  • create permissions.yml file for standalone/viaproxy
  • remove standalone permission hacks from builtin cmmands
  • isSuggestedOpOnly is kind of problematic imo, in regards to its wording and the way it is used. it can probably just be deprecated in favour of optional permission registration
  • properly handle stopping execution due to isExecutableOnConsole or isBedrockOnly with descriptive messages
  • exceptions are completely unhandled on Geyser-Standalone right now
  • convert builtin commands to fully utilize cloud features
  • pretty sure just /geyser is suppose to send help?
  • localize all messages
  • deal with possible trailing whitespace on geyser standalone gui
  • java players get suggested bedrock only commands -> additionally add platform check as a permission predicate
  • restore Spigot COMMAND_MAP lookup for descriptions
  • search CommandRegistry for our own description(s)
  • javadocs
  • check if we need to strip trailing whitespace before dispatching to cloud from BedrockCommandRequestTranslator (when Geyser Standalone is in use)
  • fix certain commands not working properly with handleNoPermission
  • i think command.failed lang might be broken
  • ensure viaproxy doesn't error on the clearing of the command manager when viaproxy was initialized, but not started
  • Spigot has a root command permission. fix regression of it being removed.
  • ensure all extension command permissions are registered on NeoForge, regardless of permission defaults. maybe just change the overall handling.
  • Fabric/NeoForge ClientCommandManager?
  • final testing

@Konicai Konicai changed the title Feature/cloud Cloud for commands Jun 2, 2023
Konicai and others added 12 commits June 2, 2023 18:52
any GeyserCommandSource should be valid to use in any CommandManager as long as one of the following is satisfied
1. it is a platform implementation
2. isConsole() returns true
2. playerUuid() returns a valid uuid and the player lookup succeeds
# Conflicts:
#	bootstrap/bungeecord/build.gradle.kts
#	bootstrap/spigot/build.gradle.kts
#	core/src/main/java/org/geysermc/geyser/command/GeyserCommandManager.java
#	core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java
# Conflicts:
#	bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java
# Conflicts:
#	bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/GeyserFabricMod.java
#	bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/FabricCommandSource.java
#	bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/GeyserFabricCommandExecutor.java
#	bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java
#	core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java
#	core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java
#	core/src/main/resources/languages
#	gradle/libs.versions.toml
@Konicai Konicai requested review from onebeastchris and Camotoy June 10, 2024 04:15
Konicai and others added 11 commits June 17, 2024 00:06
…ure/cloud

# Conflicts:
#	bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/world/GeyserModWorldManager.java
#	core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java
#	gradle/libs.versions.toml
…ure/cloud

# Conflicts:
#	core/src/main/java/org/geysermc/geyser/Constants.java
#	core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java
@Konicai Konicai changed the base branch from master to api/2.4.1 July 12, 2024 04:55
@Konicai Konicai merged commit af60a77 into GeyserMC:api/2.4.1 Jul 12, 2024
2 checks passed
letsgoawaydev pushed a commit to letsgoawaydev/Geyser that referenced this pull request Jul 21, 2024
letsgoawaydev added a commit to letsgoawaydev/Geyser that referenced this pull request Jul 21, 2024
commit 7bd4f9c
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:50:37 2024 +0800

    Half complete GuiData commit, needs some changes most likely

commit d78441a
Merge: 6338d1c 4547431
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:33:41 2024 +0800

    Merge branch 'send-toast-api' of https://github.com/letsgoawaydev/Geyser into send-toast-api

commit 6338d1c
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:33:37 2024 +0800

    test

commit 0654d2d
Author: chris <[email protected]>
Date:   Sun Jul 21 13:11:27 2024 +0200

    Fix: Text display offset <GeyserMC#4439> (GeyserMC#4883)

commit 57919db
Author: chris <[email protected]>
Date:   Sun Jul 21 02:15:38 2024 +0200

    Somewhat fix: firework recipe not showing up in recipe book (GeyserMC#4873)

    * Somewhat fix firework crafting

    * Use instanceof instead of casting

commit 23d53db
Author: chris <[email protected]>
Date:   Sun Jul 21 02:10:51 2024 +0200

    Fix: Only shutdown/close handlers in onDisable if they're nonnull (GeyserMC#4882)

commit 6459f67
Author: LetsGoAway <[email protected]>
Date:   Sat Jul 20 18:09:22 2024 +0800

    Use the correct way of sending block breaking particles (GeyserMC#4825)

commit ebc7f30
Author: Camotoy <[email protected]>
Date:   Sat Jul 20 23:22:04 2024 -0400

    Respect block range attribute where we can

    GeyserMC#4864

commit bf16ddb
Author: Camotoy <[email protected]>
Date:   Sat Jul 20 23:21:36 2024 -0400

    Small cleanups

commit 2d73e51
Author: chris <[email protected]>
Date:   Wed Jul 17 21:44:53 2024 +0200

    Properly fix hanging signs (GeyserMC#4872)

commit 3fad986
Author: Camotoy <[email protected]>
Date:   Wed Jul 17 14:21:41 2024 -0400

    Fix GeyserMC#4870

commit 3144721
Author: Valaphee The Meerkat <[email protected]>
Date:   Tue Jul 16 14:13:34 2024 +0200

    Empty player list on phase transition, despawn skulls, always reset weather (GeyserMC#4847)

    * Empty player list on transition, despawn skulls

    * Always reset weather

commit 07bdc1c
Author: masel.io <[email protected]>
Date:   Tue Jul 16 11:23:30 2024 +0200

    Add Timeout to CompletableFuture in GeyserBungeePingPassthrough to Prevent Memory Leak (GeyserMC#4858)

    * fix: Add timeout for GeyserBungeePingPassthrough#getPingInformation

    Signed-off-by: ByteExceptionM <[email protected]>

    * fix: Use Geyser Logger instead of Bungee Logger

    Signed-off-by: ByteExceptionM <[email protected]>

    * Fix typo

    Co-authored-by: Konicai <[email protected]>

    * chore: Add ip suppression if configured

    Signed-off-by: ByteExceptionM <[email protected]>

    * Remove empty line

    Co-authored-by: chris <[email protected]>

    * Remove empty line

    Co-authored-by: chris <[email protected]>

    ---------

    Signed-off-by: ByteExceptionM <[email protected]>
    Co-authored-by: Konicai <[email protected]>
    Co-authored-by: chris <[email protected]>

commit ea4a21c
Author: Camotoy <[email protected]>
Date:   Mon Jul 15 15:16:45 2024 -0400

    Indicate support for Bedrock 1.21.3

commit 6dfb1a8
Author: chris <[email protected]>
Date:   Mon Jul 15 01:31:03 2024 +0200

    Fix: Block place sounds on mod platforms (GeyserMC#4859)

commit 215b12e
Author: chris <[email protected]>
Date:   Sun Jul 14 21:55:57 2024 +0200

    Fix: Totem animation when playing totem effects manually (GeyserMC#4860)

    * Fix: Totem animation for manually played totem effects

    * Ensure we always reset the offhand correctly

commit 92112f4
Author: chris <[email protected]>
Date:   Sun Jul 14 20:17:22 2024 +0200

    Fix: Send a container close packet to Java for containers that could not be opened (GeyserMC#4861)

    * Close containers if we did not manage to open it

    * Mark session inventory translator as nonnull

commit 054fc09
Author: LetsGoAway <[email protected]>
Date:   Sun Jul 14 16:44:39 2024 +0800

    Correctly cap scale attribute (GeyserMC#4856)

    * Fix scale attribute cap

    * Update LivingEntity.java

commit c862d5a
Author: chris <[email protected]>
Date:   Sat Jul 13 22:00:15 2024 +0200

    Fix: Manually translated item names for block items not showing up properly (GeyserMC#4857)

commit 94f17d1
Author: chris <[email protected]>
Date:   Sat Jul 13 18:53:13 2024 +0200

    Fix: Item color names/glint for rare items (GeyserMC#4763)

    * debug stick changes

    * yay light purple item name

    * Address review

    * Auto-generate rarity

    * Add glint generation

    * Translate all rare items properly

    * Use putIfAbsent instead of double checks

commit e127f9e
Author: chris <[email protected]>
Date:   Fri Jul 12 20:55:40 2024 +0200

    Fix: hanging sign recipe not showing up in the recipe book (GeyserMC#4814)

commit 4547431
Merge: 96aecd2 b213fb5
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:02:04 2024 +0800

    Merge branch 'send-toast-api' of https://github.com/letsgoawaydev/Geyser into send-toast-api

commit 96aecd2
Author: chris <[email protected]>
Date:   Sun Jul 14 22:09:55 2024 +0200

    Feature: API to switch items in the offhand/mainhand (GeyserMC#4819)

commit a9c6d8b
Author: chris <[email protected]>
Date:   Fri Jul 12 20:42:31 2024 +0200

    Add a /geyser ping command  (GeyserMC#4131)

    * Init: Add /geyser ping command

    * Block just console execution, not everything but console senders

    * Use RTT as that seems to vary less wildly compared to getPing()

    * Cleanup, use lang strings

    * Add ping() method to GeyserConnection in api

    * Update to cloud changes

commit a57671e
Author: Konicai <[email protected]>
Date:   Thu Jul 11 23:56:42 2024 -0500

    Cloud for commands (GeyserMC#3808)

    Co-authored-by: onebeastchris <[email protected]>

commit b213fb5
Author: chris <[email protected]>
Date:   Sun Jul 14 22:09:55 2024 +0200

    Feature: API to switch items in the offhand/mainhand (GeyserMC#4819)

commit 51a1295
Author: chris <[email protected]>
Date:   Fri Jul 12 20:42:31 2024 +0200

    Add a /geyser ping command  (GeyserMC#4131)

    * Init: Add /geyser ping command

    * Block just console execution, not everything but console senders

    * Use RTT as that seems to vary less wildly compared to getPing()

    * Cleanup, use lang strings

    * Add ping() method to GeyserConnection in api

    * Update to cloud changes

commit af60a77
Author: Konicai <[email protected]>
Date:   Thu Jul 11 23:56:42 2024 -0500

    Cloud for commands (GeyserMC#3808)

    Co-authored-by: onebeastchris <[email protected]>
letsgoawaydev added a commit to letsgoawaydev/Geyser that referenced this pull request Jul 21, 2024
commit 7bd4f9c
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:50:37 2024 +0800

    Half complete GuiData commit, needs some changes most likely

commit d78441a
Merge: 6338d1c 4547431
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:33:41 2024 +0800

    Merge branch 'send-toast-api' of https://github.com/letsgoawaydev/Geyser into send-toast-api

commit 6338d1c
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:33:37 2024 +0800

    test

commit 0654d2d
Author: chris <[email protected]>
Date:   Sun Jul 21 13:11:27 2024 +0200

    Fix: Text display offset <GeyserMC#4439> (GeyserMC#4883)

commit 57919db
Author: chris <[email protected]>
Date:   Sun Jul 21 02:15:38 2024 +0200

    Somewhat fix: firework recipe not showing up in recipe book (GeyserMC#4873)

    * Somewhat fix firework crafting

    * Use instanceof instead of casting

commit 23d53db
Author: chris <[email protected]>
Date:   Sun Jul 21 02:10:51 2024 +0200

    Fix: Only shutdown/close handlers in onDisable if they're nonnull (GeyserMC#4882)

commit 6459f67
Author: LetsGoAway <[email protected]>
Date:   Sat Jul 20 18:09:22 2024 +0800

    Use the correct way of sending block breaking particles (GeyserMC#4825)

commit ebc7f30
Author: Camotoy <[email protected]>
Date:   Sat Jul 20 23:22:04 2024 -0400

    Respect block range attribute where we can

    GeyserMC#4864

commit bf16ddb
Author: Camotoy <[email protected]>
Date:   Sat Jul 20 23:21:36 2024 -0400

    Small cleanups

commit 2d73e51
Author: chris <[email protected]>
Date:   Wed Jul 17 21:44:53 2024 +0200

    Properly fix hanging signs (GeyserMC#4872)

commit 3fad986
Author: Camotoy <[email protected]>
Date:   Wed Jul 17 14:21:41 2024 -0400

    Fix GeyserMC#4870

commit 3144721
Author: Valaphee The Meerkat <[email protected]>
Date:   Tue Jul 16 14:13:34 2024 +0200

    Empty player list on phase transition, despawn skulls, always reset weather (GeyserMC#4847)

    * Empty player list on transition, despawn skulls

    * Always reset weather

commit 07bdc1c
Author: masel.io <[email protected]>
Date:   Tue Jul 16 11:23:30 2024 +0200

    Add Timeout to CompletableFuture in GeyserBungeePingPassthrough to Prevent Memory Leak (GeyserMC#4858)

    * fix: Add timeout for GeyserBungeePingPassthrough#getPingInformation

    Signed-off-by: ByteExceptionM <[email protected]>

    * fix: Use Geyser Logger instead of Bungee Logger

    Signed-off-by: ByteExceptionM <[email protected]>

    * Fix typo

    Co-authored-by: Konicai <[email protected]>

    * chore: Add ip suppression if configured

    Signed-off-by: ByteExceptionM <[email protected]>

    * Remove empty line

    Co-authored-by: chris <[email protected]>

    * Remove empty line

    Co-authored-by: chris <[email protected]>

    ---------

    Signed-off-by: ByteExceptionM <[email protected]>
    Co-authored-by: Konicai <[email protected]>
    Co-authored-by: chris <[email protected]>

commit ea4a21c
Author: Camotoy <[email protected]>
Date:   Mon Jul 15 15:16:45 2024 -0400

    Indicate support for Bedrock 1.21.3

commit 6dfb1a8
Author: chris <[email protected]>
Date:   Mon Jul 15 01:31:03 2024 +0200

    Fix: Block place sounds on mod platforms (GeyserMC#4859)

commit 215b12e
Author: chris <[email protected]>
Date:   Sun Jul 14 21:55:57 2024 +0200

    Fix: Totem animation when playing totem effects manually (GeyserMC#4860)

    * Fix: Totem animation for manually played totem effects

    * Ensure we always reset the offhand correctly

commit 92112f4
Author: chris <[email protected]>
Date:   Sun Jul 14 20:17:22 2024 +0200

    Fix: Send a container close packet to Java for containers that could not be opened (GeyserMC#4861)

    * Close containers if we did not manage to open it

    * Mark session inventory translator as nonnull

commit 054fc09
Author: LetsGoAway <[email protected]>
Date:   Sun Jul 14 16:44:39 2024 +0800

    Correctly cap scale attribute (GeyserMC#4856)

    * Fix scale attribute cap

    * Update LivingEntity.java

commit c862d5a
Author: chris <[email protected]>
Date:   Sat Jul 13 22:00:15 2024 +0200

    Fix: Manually translated item names for block items not showing up properly (GeyserMC#4857)

commit 94f17d1
Author: chris <[email protected]>
Date:   Sat Jul 13 18:53:13 2024 +0200

    Fix: Item color names/glint for rare items (GeyserMC#4763)

    * debug stick changes

    * yay light purple item name

    * Address review

    * Auto-generate rarity

    * Add glint generation

    * Translate all rare items properly

    * Use putIfAbsent instead of double checks

commit e127f9e
Author: chris <[email protected]>
Date:   Fri Jul 12 20:55:40 2024 +0200

    Fix: hanging sign recipe not showing up in the recipe book (GeyserMC#4814)

commit 4547431
Merge: 96aecd2 b213fb5
Author: Ethan <[email protected]>
Date:   Sun Jul 21 21:02:04 2024 +0800

    Merge branch 'send-toast-api' of https://github.com/letsgoawaydev/Geyser into send-toast-api

commit 96aecd2
Author: chris <[email protected]>
Date:   Sun Jul 14 22:09:55 2024 +0200

    Feature: API to switch items in the offhand/mainhand (GeyserMC#4819)

commit a9c6d8b
Author: chris <[email protected]>
Date:   Fri Jul 12 20:42:31 2024 +0200

    Add a /geyser ping command  (GeyserMC#4131)

    * Init: Add /geyser ping command

    * Block just console execution, not everything but console senders

    * Use RTT as that seems to vary less wildly compared to getPing()

    * Cleanup, use lang strings

    * Add ping() method to GeyserConnection in api

    * Update to cloud changes

commit a57671e
Author: Konicai <[email protected]>
Date:   Thu Jul 11 23:56:42 2024 -0500

    Cloud for commands (GeyserMC#3808)

    Co-authored-by: onebeastchris <[email protected]>
Konicai added a commit that referenced this pull request Aug 1, 2024
Co-authored-by: onebeastchris <[email protected]>
@Konicai Konicai deleted the feature/cloud branch August 28, 2024 20:01
XingLingQAQ pushed a commit to XingLingQAQ/Geyser that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Under Review When a PR (particularly a large one) is currently being reviewed to see if it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants