Interface ContainerEventHandler

All Superinterfaces:
GuiEventListener, TabOrderedElement
All Known Implementing Classes:
AbstractCommandBlockEditScreen, AbstractContainerEventHandler, AbstractContainerScreen, AbstractContainerWidget, AbstractFurnaceScreen, AbstractReportScreen, AbstractReportScreen.DiscardReportWarningScreen, AbstractSelectionList, AbstractSignEditScreen, AbstractTestScreen, AbstractTestScreen.GroupableList, AccessibilityOnboardingScreen, AccessibilityOptionsScreen, AddRealmPopupScreen, AdvancementsScreen, AlertScreen, AnvilScreen, BackupConfirmScreen, BeaconScreen, BlastFurnaceScreen, BookEditScreen, BookViewScreen, BrewingStandScreen, CartographyTableScreen, ChatOptionsScreen, ChatReportScreen, ChatScreen, ChatSelectionScreen, ChatSelectionScreen.ChatSelectionList, ClientCommonPacketListenerImpl.PackConfirmScreen, CommandBlockEditScreen, ConfigurationScreen, ConfigurationScreen.ConfigurationListScreen, ConfigurationScreen.ConfigurationListScreen.ListLabelWidget, ConfigurationScreen.ConfigurationSectionScreen, ConfigurationScreen.TooltipConfirmScreen, ConfirmExperimentalFeaturesScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen.PackList, ConfirmLinkScreen, ConfirmScreen, ConnectScreen, ContainerObjectSelectionList, ContainerObjectSelectionList.Entry, ContainerScreen, ContainerTypeTest.TestGui, ControlsScreen, CrafterScreen, CraftingScreen, CreateBuffetWorldScreen, CreateBuffetWorldScreen.BiomeList, CreateFlatWorldScreen, CreateFlatWorldScreen.DetailsList, CreateWorldScreen, CreativeModeInventoryScreen, CreditsAndAttributionScreen, CustomPresetEditorTest.SwampDesertScreen, CustomTooltipTest.TooltipTestScreen, DatapackLoadFailureScreen, DeathScreen, DeathScreen.TitleConfirmScreen, DemoIntroScreen, DimensionTransitionScreenTests.CustomLevelScreen, DirectJoinServerScreen, DisconnectedRealmsScreen, DisconnectedScreen, DispenserScreen, EditGameRulesScreen, EditGameRulesScreen.BooleanRuleEntry, EditGameRulesScreen.CategoryRuleEntry, EditGameRulesScreen.GameRuleEntry, EditGameRulesScreen.IntegerRuleEntry, EditGameRulesScreen.RuleEntry, EditGameRulesScreen.RuleList, EditServerScreen, EditWorldScreen, EffectRenderingInventoryScreen, EnchantmentScreen, ErrorScreen, ExperimentsScreen, FontOptionsScreen, FurnaceScreen, GameModeSwitcherScreen, GenericMessageScreen, GenericWaitingScreen, GrindstoneScreen, GuiTests.TestLayer, HangingSignEditScreen, HopperScreen, HorseInventoryScreen, InBedChatScreen, InventoryScreen, ItemCombinerScreen, JigsawBlockEditScreen, JoinMultiplayerScreen, KeyBindsList, KeyBindsList.CategoryEntry, KeyBindsList.Entry, KeyBindsList.KeyEntry, KeyBindsScreen, LanguageSelectScreen, LanguageSelectScreen.LanguageSelectionList, LecternScreen, LevelLoadingScreen, LoadingErrorScreen, LoadingErrorScreen.LoadingEntryList, LoomScreen, MerchantScreen, MinecartCommandBlockEditScreen, ModListScreen, ModListScreen.InfoPanel, ModListWidget, ModMismatchDisconnectedScreen, ModMismatchDisconnectedScreen.MismatchInfoPanel, MouseSettingsScreen, NameReportScreen, NoticeWithLinkScreen, ObjectSelectionList, OnlineOptionsScreen, OptimizeWorldScreen, OptionsList, OptionsList.Entry, OptionsList.OptionEntry, OptionsScreen, OptionsSubScreen, OutOfMemoryScreen, PackSelectionScreen, PauseScreen, PauseScreen.FeedbackSubScreen, PlayerEntry, PopupScreen, PresetFlatWorldScreen, PresetFlatWorldScreen.PresetsList, ProgressScreen, RealmsBackupInfoScreen, RealmsBackupInfoScreen.BackupInfoList, RealmsBackupScreen, RealmsBackupScreen.BackupObjectSelectionList, RealmsBackupScreen.Entry, RealmsBrokenWorldScreen, RealmsClientOutdatedScreen, RealmsConfigureWorldScreen, RealmsConfirmScreen, RealmsCreateRealmScreen, RealmsDownloadLatestWorldScreen, RealmsGenericErrorScreen, RealmsInviteScreen, RealmsLongRunningMcoTaskScreen, RealmsLongRunningMcoTickTaskScreen, RealmsMainScreen, RealmsMainScreen.RealmSelectionList, RealmsNotificationsScreen, RealmsObjectSelectionList, RealmsParentalConsentScreen, RealmsPendingInvitesScreen, RealmsPendingInvitesScreen.PendingInvitationSelectionList, RealmsPlayerScreen, RealmsPlayerScreen.Entry, RealmsPlayerScreen.InvitedObjectSelectionList, RealmsResetNormalWorldScreen, RealmsResetWorldScreen, RealmsScreen, RealmsSelectFileToUploadScreen, RealmsSelectFileToUploadScreen.WorldSelectionList, RealmsSelectWorldTemplateScreen, RealmsSelectWorldTemplateScreen.WorldTemplateList, RealmsSettingsScreen, RealmsSlotOptionsScreen, RealmsSubscriptionInfoScreen, RealmsTermsScreen, RealmsUploadScreen, ReceivingLevelScreen, RecipeBookTestScreen, RecoverWorldDataScreen, ReportPlayerScreen, ReportReasonSelectionScreen, ReportReasonSelectionScreen.ReasonSelectionList, SafetyScreen, Screen, ScrollableExperimentsScreen, ScrollableExperimentsScreen.ExperimentSelectionList, ScrollableExperimentsScreen.ExperimentSelectionList.ExperimentEntry, ScrollPanel, SelectWorldScreen, ServerLinksScreen, ServerLinksScreen.LinkList, ServerLinksScreen.LinkListEntry, ServerReconfigScreen, ServerSelectionList, ShareToLanScreen, ShulkerBoxScreen, SignEditScreen, SkinCustomizationScreen, SkinReportScreen, SmithingScreen, SmokerScreen, SocialInteractionsPlayerList, SocialInteractionsScreen, SoundOptionsScreen, StatsScreen, StatsScreen.GeneralStatisticsList, StatsScreen.ItemStatisticsList, StatsScreen.MobsStatisticsList, StonecutterScreen, StructureBlockEditScreen, TabNavigationBar, TelemetryInfoScreen, TestScreen, TestScreen, TitleScreen, TransferableSelectionList, UnsupportedGraphicsWarningScreen, VideoSettingsScreen, WarningScreen, WinScreen, WorldSelectionList

public interface ContainerEventHandler extends GuiEventListener
  • Method Details

    • children

      List<? extends GuiEventListener> children()
    • getChildAt

      default Optional<GuiEventListener> getChildAt(double pMouseX, double pMouseY)
      Returns the first event listener that intersects with the mouse coordinates.
    • mouseClicked

      default boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      Called when a mouse button is clicked within the GUI element.

      Specified by:
      mouseClicked in interface GuiEventListener
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseReleased

      default boolean mouseReleased(double pMouseX, double pMouseY, int pButton)
      Called when a mouse button is released within the GUI element.

      Specified by:
      mouseReleased in interface GuiEventListener
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was released.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseDragged

      default boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY)
      Called when the mouse is dragged within the GUI element.

      Specified by:
      mouseDragged in interface GuiEventListener
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that is being dragged.
      pDragX - the X distance of the drag.
      pDragY - the Y distance of the drag.
      Returns:
      true if the event is consumed, false otherwise.
    • isDragging

      boolean isDragging()
    • setDragging

      void setDragging(boolean pIsDragging)
      Sets if the GUI element is dragging or not.
      Parameters:
      pIsDragging - the dragging state of the GUI element.
    • mouseScrolled

      default boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY)
      Specified by:
      mouseScrolled in interface GuiEventListener
    • keyPressed

      default boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface GuiEventListener
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • keyReleased

      default boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is released within the GUI element.

      Specified by:
      keyReleased in interface GuiEventListener
      Parameters:
      pKeyCode - the key code of the released key.
      pScanCode - the scan code of the released key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • charTyped

      default boolean charTyped(char pCodePoint, int pModifiers)
      Called when a character is typed within the GUI element.

      Specified by:
      charTyped in interface GuiEventListener
      Parameters:
      pCodePoint - the code point of the typed character.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • getFocused

      @Nullable GuiEventListener getFocused()
    • setFocused

      void setFocused(@Nullable GuiEventListener pFocused)
      Sets the focus state of the GUI element.
      Parameters:
      pFocused - the focused GUI element.
    • setFocused

      default void setFocused(boolean pFocused)
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface GuiEventListener
      Parameters:
      pFocused - true to apply focus, false to remove focus
    • isFocused

      default boolean isFocused()
      Specified by:
      isFocused in interface GuiEventListener
    • getCurrentFocusPath

      @Nullable default ComponentPath getCurrentFocusPath()
      Specified by:
      getCurrentFocusPath in interface GuiEventListener
    • nextFocusPath

      @Nullable default ComponentPath nextFocusPath(FocusNavigationEvent pEvent)
      Retrieves the next focus path based on the given focus navigation event.

      Specified by:
      nextFocusPath in interface GuiEventListener
      Parameters:
      pEvent - the focus navigation event.
      Returns:
      The next focus path as a ComponentPath, or null if there is no next focus path.
    • handleTabNavigation

      @Nullable private ComponentPath handleTabNavigation(FocusNavigationEvent.TabNavigation pTabNavigation)
      Handles tab-based navigation events.

      Parameters:
      pTabNavigation - The tab navigation event.
      Returns:
      The next focus path for tab navigation, or null if no suitable path is found.
    • handleArrowNavigation

      @Nullable private ComponentPath handleArrowNavigation(FocusNavigationEvent.ArrowNavigation pArrowNavigation)
      Handles arrow-based navigation events.

      Parameters:
      pArrowNavigation - The arrow navigation event.
      Returns:
      The next focus path for arrow navigation, or null if no suitable path is found.
    • nextFocusPathInDirection

      @Nullable private ComponentPath nextFocusPathInDirection(ScreenRectangle pRectangle, ScreenDirection pDirection, @Nullable GuiEventListener pListener, FocusNavigationEvent pEvent)
      Calculates the next focus path in a specific direction.

      Parameters:
      pRectangle - The screen rectangle.
      pDirection - The direction of navigation.
      pListener - The currently focused GUI event listener.
      pEvent - The focus navigation event.
      Returns:
      The next focus path in the specified direction, or null if no suitable path is found.
    • nextFocusPathVaguelyInDirection

      @Nullable private ComponentPath nextFocusPathVaguelyInDirection(ScreenRectangle pRectangle, ScreenDirection pDirection, @Nullable GuiEventListener pListener, FocusNavigationEvent pEvent)
      Calculates the next focus path in a vague direction.

      Parameters:
      pRectangle - The screen rectangle.
      pDirection - The direction of navigation.
      pListener - The currently focused GUI event listener.
      pEvent - The focus navigation event.
      Returns:
      The next focus path in the vague direction, or null if no suitable path is found.