Package hiiragi283.core.common.registry
Class HTDeferredMenuType.OnHand
-
- All Implemented Interfaces:
-
hiiragi283.core.api.registry.HTHolderLike,hiiragi283.core.api.resource.HTIdLike,hiiragi283.core.api.resource.HTKeyLike,java.util.function.Supplier
public final class HTDeferredMenuType.OnHand<MENU extends AbstractContainerMenu> extends HTDeferredMenuType<MENU, HTItemMenuType<MENU>>
-
-
Constructor Summary
Constructors Constructor Description HTDeferredMenuType.OnHand(ResourceKey<MenuType<?>> key)HTDeferredMenuType.OnHand(ResourceLocation id)
-
Method Summary
Modifier and Type Method Description final MenuProvidergetProvider(InteractionHand hand, ItemStack stack)指定されたhand, stackからMenuProviderを返します。 final InteractionResultopenMenu(Player player, InteractionHand hand, ItemStack stack)指定されたplayer, hand, stackから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
-
-
Method Detail
-
getProvider
final MenuProvider getProvider(InteractionHand hand, ItemStack stack)
- Parameters:
hand- このGUIを開くstackを持っているInteractionHandstack- このGUIを開くItemStack- Returns:
getの戻り値がItemStackを継承していない場合は
null
-
openMenu
final InteractionResult openMenu(Player player, InteractionHand hand, ItemStack stack)
- Parameters:
player- このGUIを開くPlayerhand- このGUIを開くstackを持っているInteractionHandstack- このGUIを開くItemStack- Returns:
クライアント側の場合はInteractionResult.SUCCESS,サーバー側の場合はGUIを開いたうえでInteractionResult.CONSUME, getProviderが
nullの場合はInteractionResult.FAIL
-
-
-
-