Interface ContainerEventHandler

All Superinterfaces:
GuiEventListener, TabOrderedElement
All Known Implementing Classes:
AbstractCommandBlockEditScreen, AbstractContainerEventHandler, AbstractContainerScreen, AbstractContainerWidget, AbstractFurnaceScreen, AbstractRecipeBookScreen, AbstractReportScreen, AbstractReportScreen.DiscardReportWarningScreen, AbstractSelectionList, AbstractSignEditScreen, AccessibilityOnboardingScreen, AccessibilityOptionsScreen, AddRealmPopupScreen, AdvancementsScreen, AlertScreen, AnvilScreen, BackupConfirmScreen, BeaconScreen, BlastFurnaceScreen, BookEditScreen, BookSignScreen, BookViewScreen, BrewingStandScreen, ButtonListDialogScreen, CartographyTableScreen, ChatOptionsScreen, ChatReportScreen, ChatScreen, ChatSelectionScreen, ChatSelectionScreen.ChatSelectionList, ClientCommonPacketListenerImpl.PackConfirmScreen, CodeOfConductScreen, CommandBlockEditScreen, ConfigurationScreen, ConfigurationScreen.ConfigurationListScreen, ConfigurationScreen.ConfigurationListScreen.ListLabelWidget, ConfigurationScreen.ConfigurationSectionScreen, ConfigurationScreen.TooltipConfirmScreen, ConfirmExperimentalFeaturesScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen.PackList, ConfirmLinkScreen, ConfirmScreen, ConnectScreen, ContainerObjectSelectionList, ContainerObjectSelectionList.Entry, ContainerScreen, ControlsScreen, CrafterScreen, CraftingScreen, CreateBuffetWorldScreen, CreateBuffetWorldScreen.BiomeList, CreateFlatWorldScreen, CreateFlatWorldScreen.DetailsList, CreateWorldScreen, CreativeModeInventoryScreen, CreditsAndAttributionScreen, DatapackLoadFailureScreen, DeathScreen, DeathScreen.TitleConfirmScreen, DebugOptionsScreen, DebugOptionsScreen.AbstractOptionEntry, DebugOptionsScreen.CategoryEntry, DebugOptionsScreen.OptionEntry, DebugOptionsScreen.OptionList, DemoIntroScreen, DialogListDialogScreen, DialogScreen, DialogScreen.WarningScreen, DirectJoinServerScreen, DisconnectedScreen, DispenserScreen, EditGameRulesScreen, EditGameRulesScreen.BooleanRuleEntry, EditGameRulesScreen.CategoryRuleEntry, EditGameRulesScreen.GameRuleEntry, EditGameRulesScreen.IntegerRuleEntry, EditGameRulesScreen.RuleEntry, EditGameRulesScreen.RuleList, EditWorldScreen, EnchantmentScreen, ErrorScreen, ExperimentsScreen, FontOptionsScreen, FurnaceScreen, GameModeSwitcherScreen, GenericMessageScreen, GenericWaitingScreen, GrindstoneScreen, 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, ManageServerScreen, MerchantScreen, MinecartCommandBlockEditScreen, ModListScreen, ModListScreen.InfoPanel, ModListWidget, ModMismatchDisconnectedScreen, ModMismatchDisconnectedScreen.MismatchInfoPanel, MouseSettingsScreen, MultiButtonDialogScreen, 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, RealmsLongRunningMcoConnectTaskScreen, RealmsLongRunningMcoTaskScreen, RealmsMainScreen, RealmsMainScreen.RealmSelectionList, RealmsNotificationsScreen, RealmsParentalConsentScreen, RealmsPendingInvitesScreen, RealmsPendingInvitesScreen.Entry, RealmsPendingInvitesScreen.PendingInvitationSelectionList, RealmsPlayersTab.Entry, RealmsPlayersTab.HeaderEntry, RealmsPlayersTab.InvitedObjectSelectionList, RealmsPlayersTab.PlayerEntry, RealmsPreferredRegionSelectionScreen, RealmsPreferredRegionSelectionScreen.RegionSelectionList, RealmsResetWorldScreen, RealmsScreen, RealmsSelectFileToUploadScreen, RealmsSelectWorldTemplateScreen, RealmsSelectWorldTemplateScreen.WorldTemplateList, RealmsSlotOptionsScreen, RealmsTermsScreen, RealmsUploadScreen, RecoverWorldDataScreen, ReportPlayerScreen, ReportReasonSelectionScreen, ReportReasonSelectionScreen.ReasonSelectionList, SafetyScreen, Screen, ScrollableLayout.Container, ScrollPanel, SelectWorldScreen, ServerLinksDialogScreen, ServerReconfigScreen, ServerSelectionList, ShareToLanScreen, ShulkerBoxScreen, SignEditScreen, SimpleDialogScreen, SkinCustomizationScreen, SkinReportScreen, SmithingScreen, SmokerScreen, SocialInteractionsPlayerList, SocialInteractionsScreen, SoundOptionsScreen, StatsScreen, StatsScreen.GeneralStatisticsList, StatsScreen.ItemStatisticsList, StatsScreen.ItemStatisticsList.Entry, StatsScreen.ItemStatisticsList.HeaderEntry, StatsScreen.ItemStatisticsList.ItemRow, StatsScreen.MobsStatisticsList, StonecutterScreen, StructureBlockEditScreen, TabNavigationBar, TelemetryInfoScreen, TestBlockEditScreen, TestInstanceBlockEditScreen, TitleScreen, TransferableSelectionList, UnsupportedGraphicsWarningScreen, VideoSettingsScreen, WaitingForResponseScreen, 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(MouseButtonEvent p_446542_, boolean p_434187_)
      Specified by:
      mouseClicked in interface GuiEventListener
    • mouseReleased

      default boolean mouseReleased(MouseButtonEvent p_446955_)
      Specified by:
      mouseReleased in interface GuiEventListener
    • mouseDragged

      default boolean mouseDragged(MouseButtonEvent p_446602_, double p_94699_, double p_94700_)
      Specified by:
      mouseDragged in interface GuiEventListener
    • 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 p_94686_, double p_94687_, double p_94688_, double p_294830_)
      Specified by:
      mouseScrolled in interface GuiEventListener
    • keyPressed

      default boolean keyPressed(KeyEvent p_446608_)
      Specified by:
      keyPressed in interface GuiEventListener
    • keyReleased

      default boolean keyReleased(KeyEvent p_447007_)
      Specified by:
      keyReleased in interface GuiEventListener
    • charTyped

      default boolean charTyped(CharacterEvent p_446550_)
      Specified by:
      charTyped in interface GuiEventListener
    • 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 p_265504_)
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface GuiEventListener
      Parameters:
      p_265504_ - 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 p_265668_)
      Retrieves the next focus path based on the given focus navigation event.

      Specified by:
      nextFocusPath in interface GuiEventListener
      Parameters:
      p_265668_ - 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.