Class HTDeferredMenuType.WithContext

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final MenuProvider getProvider(Component title, Object obj) 指定されたtitlecontextからMenuProviderを返します。
      final InteractionResult openMenu(Player player, Component title, Object obj, Function1<RegistryFriendlyByteBuf, Unit> writer) 指定されたplayer, title, contextからGUIを開きます。
      • Methods inherited from class hiiragi283.core.common.registry.HTDeferredMenuType

        get, getResourceKey, getVanillaProvider
      • Methods inherited from class hiiragi283.core.api.resource.HTKeyLike

        getId
      • Methods inherited from class hiiragi283.core.api.resource.HTIdLike

        getNamespace, getPath
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTDeferredMenuType.WithContext

        HTDeferredMenuType.WithContext(ResourceKey<MenuType<?>> key)
      • HTDeferredMenuType.WithContext

        HTDeferredMenuType.WithContext(ResourceLocation id)
    • Method Detail

      • getProvider

         final MenuProvider getProvider(Component title, Object obj)

        指定されたtitlecontextからMenuProviderを返します。

        Parameters:
        title - このGUIのタイトル
        Returns:

        getの戻り値がHTContainerFactoryを継承していない場合はnull

      • openMenu

         final InteractionResult openMenu(Player player, Component title, Object obj, Function1<RegistryFriendlyByteBuf, Unit> writer)

        指定されたplayer, title, contextからGUIを開きます。

        Parameters:
        player - このGUIを開くプレイヤー
        title - このGUIのタイトル
        writer - RegistryFriendlyByteBufに追加の情報を書き込むブロック
        Returns:

        クライアント側の場合はInteractionResult.SUCCESS,サーバー側の場合はGUIを開いたうえでInteractionResult.CONSUME, getProvidernullの場合はInteractionResult.FAIL