Class BotServiceImpl

All Implemented Interfaces:
BotServiceGrpc.AsyncService, io.grpc.BindableService

public final class BotServiceImpl extends BotServiceGrpc.BotServiceImplBase
  • Constructor Details

    • BotServiceImpl

      public BotServiceImpl(SoulFireServer soulFireServer)
  • Method Details

    • updateBotConfigEntry

      public void updateBotConfigEntry(BotUpdateConfigEntryRequest request, io.grpc.stub.StreamObserver<BotUpdateConfigEntryResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Updates a single configuration entry for a specific bot.
      The configuration is persisted to the database immediately.
      Requires UPDATE_BOT_CONFIG permission.
      
    • getBotList

      public void getBotList(BotListRequest request, io.grpc.stub.StreamObserver<BotListResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Returns a list of all bots configured in the specified instance.
      Includes both online and offline bots with their current status.
      For online bots, includes live state (position, health, etc.) but NOT full inventory data.
      Requires READ_BOT_INFO permission.
      
    • getBotInfo

      public void getBotInfo(BotInfoRequest request, io.grpc.stub.StreamObserver<BotInfoResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Returns detailed information about a specific bot.
      Includes full live state with complete inventory data when the bot is online.
      Requires READ_BOT_INFO permission.
      
    • renderBotPov

      public void renderBotPov(BotRenderPovRequest request, io.grpc.stub.StreamObserver<BotRenderPovResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Renders the bot's point-of-view as a PNG image using software rendering.
      The bot must be online with a valid player and level.
      Uses the bot's current render distance setting.
      Requires READ_BOT_INFO permission.
      
    • clickInventorySlot

      public void clickInventorySlot(BotInventoryClickRequest request, io.grpc.stub.StreamObserver<BotInventoryClickResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Performs a click action on an inventory/container slot.
      Supports various click types (left, right, shift, drop, swap, middle).
      The bot must be online with a valid player and gameMode.
      Requires UPDATE_BOT_CONFIG permission.
      
    • getInventoryState

      public void getInventoryState(BotInventoryStateRequest request, io.grpc.stub.StreamObserver<BotInventoryStateResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Returns the current state of the bot's open container/inventory.
      Includes layout information, slot contents, and carried item.
      The bot must be online with a valid player.
      Requires READ_BOT_INFO permission.
      
    • closeContainer

      public void closeContainer(BotCloseContainerRequest request, io.grpc.stub.StreamObserver<BotCloseContainerResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Closes the currently open container (chest, crafting table, etc.).
      Returns to the player inventory view.
      The bot must be online with a valid player.
      Requires UPDATE_BOT_CONFIG permission.
      
    • openInventory

      public void openInventory(BotOpenInventoryRequest request, io.grpc.stub.StreamObserver<BotOpenInventoryResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Opens the player's inventory screen.
      Sends a packet to the server to display the inventory UI.
      The bot must be online with a valid player.
      Requires UPDATE_BOT_CONFIG permission.
      
    • mouseClick

      public void mouseClick(BotMouseClickRequest request, io.grpc.stub.StreamObserver<BotMouseClickResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Simulates a mouse click in the game world.
      Left click: attack entity or start breaking block.
      Right click: use item or interact with entity/block.
      The bot must be online with valid player, level, and gameMode.
      Requires UPDATE_BOT_CONFIG permission.
      
    • clickContainerButton

      public void clickContainerButton(BotContainerButtonClickRequest request, io.grpc.stub.StreamObserver<BotContainerButtonClickResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Clicks a container-specific action button.
      Used for: stonecutter recipes, enchanting, loom patterns, villager trades,
      beacon effects, crafter slot toggles, lectern page navigation.
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.
      
    • setContainerText

      public void setContainerText(BotSetContainerTextRequest request, io.grpc.stub.StreamObserver<BotSetContainerTextResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Sets text in a container's text input field.
      Currently only supports anvil item renaming (field_id: "item_name").
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.
      
    • getDialog

      public void getDialog(BotGetDialogRequest request, io.grpc.stub.StreamObserver<BotGetDialogResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Returns the currently displayed server dialog (Minecraft 1.21.6+).
      Dialogs are server-sent UI screens for custom interactions.
      Returns empty response if no dialog is being shown.
      Does not require the bot to be online (but dialog will be absent).
      Requires READ_BOT_INFO permission.
      
    • submitDialog

      public void submitDialog(BotSubmitDialogRequest request, io.grpc.stub.StreamObserver<BotSubmitDialogResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Submits a dialog with input values.
      Used for dialogs containing text fields, checkboxes, dropdowns, or sliders.
      The dialog is closed after submission.
      Note: Full dialog response packets are not yet implemented; this clears local state.
      Requires UPDATE_BOT_CONFIG permission.
      
    • clickDialogButton

      public void clickDialogButton(BotClickDialogButtonRequest request, io.grpc.stub.StreamObserver<BotClickDialogButtonResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Clicks a button in the current dialog.
      Button index depends on dialog type (see BotClickDialogButtonRequest).
      The dialog is typically closed after the button click.
      Note: Full dialog button packets are not yet implemented; this clears local state.
      Requires UPDATE_BOT_CONFIG permission.
      
    • closeDialog

      public void closeDialog(BotCloseDialogRequest request, io.grpc.stub.StreamObserver<BotCloseDialogResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Closes/dismisses the current dialog.
      Clears the local dialog state.
      Requires UPDATE_BOT_CONFIG permission.
      
    • setHotbarSlot

      public void setHotbarSlot(BotSetHotbarSlotRequest request, io.grpc.stub.StreamObserver<BotSetHotbarSlotResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Changes the selected hotbar slot.
      Valid slot range: 0-8 (corresponding to slots 1-9 in the UI).
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.
      
    • setMovementState

      public void setMovementState(BotSetMovementStateRequest request, io.grpc.stub.StreamObserver<BotSetMovementStateResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Updates the bot's movement state (WASD, jump, sneak, sprint).
      Only specified fields are changed; omitted fields retain their current value.
      Movement persists until explicitly changed or reset.
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.
      
    • resetMovement

      public void resetMovement(BotResetMovementRequest request, io.grpc.stub.StreamObserver<BotResetMovementResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Resets all movement to stopped state.
      Equivalent to releasing all movement keys.
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.
      
    • setRotation

      public void setRotation(BotSetRotationRequest request, io.grpc.stub.StreamObserver<BotSetRotationResponse> responseObserver)
      Description copied from interface: BotServiceGrpc.AsyncService
      Sets the bot's view rotation (look direction).
      Yaw is normalized to -180 to 180, pitch is clamped to -90 to 90.
      The action is queued and executed on the next game tick.
      Requires UPDATE_BOT_CONFIG permission.