接口 ISwitchable

所有已知子接口:
IInfinityClockSwitchable
所有已知实现类:
BlazeAxeItem, BlazeBowItem, BlazeHoeItem, BlazePickaxeItem, BlazeShovelItem, BlazeSwordItem, CrystalBowItem, CrystalSwordItem, InfinityAxeItem, InfinityBowItem, InfinityClockItem, InfinityCrossBowItem, InfinityHoeItem, InfinityPickaxeItem, InfinityShovelItem, InfinitySwordItem, InfinityTridentItem, InfinityUmbrellaItem

public interface ISwitchable
  • 方法概要

    修饰符和类型
    方法
    说明
    default void
    cycleMode(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, List<String> modeList)
    循环切换模式
    static int
    getCurrentMode(net.minecraft.world.item.ItemStack stack, List<String> modeList)
    获取当前激活的模式
    default int
    getCurrentModeIndex(net.minecraft.world.item.ItemStack stack, List<String> modeList)
    获取当前激活的模式(实例方法)
    default boolean
    isActive(net.minecraft.world.item.ItemStack stack, String funcName)
    检查指定功能是否处于激活状态(实例方法)
    static boolean
    isMode(net.minecraft.world.item.ItemStack stack, String funcName)
    检查指定功能是否处于激活状态
    default void
    setMode(net.minecraft.world.item.ItemStack stack, List<String> modeList, int modeIndex)
    设置指定模式为激活状态
    default void
    switchMode(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, String funcName)
    保持原有的单功能切换方法(向后兼容)
    default void
    switchToMode(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, List<String> modeList, String modeName)
    切换到指定功能模式
  • 方法详细资料

    • isMode

      static boolean isMode(net.minecraft.world.item.ItemStack stack, String funcName)
      检查指定功能是否处于激活状态
      参数:
      stack - 物品堆
      funcName - 功能名称
      返回:
      是否激活
    • isActive

      default boolean isActive(net.minecraft.world.item.ItemStack stack, String funcName)
      检查指定功能是否处于激活状态(实例方法)
      参数:
      stack - 物品堆
      funcName - 功能名称
      返回:
      是否激活
    • getCurrentMode

      static int getCurrentMode(net.minecraft.world.item.ItemStack stack, List<String> modeList)
      获取当前激活的模式
      参数:
      stack - 物品堆
      modeList - 模式列表
      返回:
      当前模式索引,-1表示无激活模式
    • getCurrentModeIndex

      default int getCurrentModeIndex(net.minecraft.world.item.ItemStack stack, List<String> modeList)
      获取当前激活的模式(实例方法)
      参数:
      stack - 物品堆
      modeList - 模式列表
      返回:
      当前模式索引,-1表示无激活模式
    • setMode

      default void setMode(net.minecraft.world.item.ItemStack stack, List<String> modeList, int modeIndex)
      设置指定模式为激活状态
      参数:
      stack - 物品堆
      modeList - 模式列表
      modeIndex - 要激活的模式索引
    • cycleMode

      default void cycleMode(@NotNull @NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand, List<String> modeList)
      循环切换模式
      参数:
      world - 世界
      player - 玩家
      hand - 手部
      modeList - 模式列表
    • switchToMode

      default void switchToMode(@NotNull @NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand, List<String> modeList, String modeName)
      切换到指定功能模式
      参数:
      world - 世界
      player - 玩家
      hand - 手部
      modeList - 模式列表
      modeName - 要切换到的模式名称
    • switchMode

      default void switchMode(@NotNull @NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand, String funcName)
      保持原有的单功能切换方法(向后兼容)
      参数:
      world - 世界
      player - 玩家
      hand - 手部
      funcName - 功能名称