接口 ISwitchable
- 所有已知子接口:
IInfinityClockSwitchable
- 所有已知实现类:
BlazeAxeItem,BlazeBowItem,BlazeHoeItem,BlazePickaxeItem,BlazeShovelItem,BlazeSwordItem,CrystalBowItem,CrystalSwordItem,InfinityAxeItem,InfinityBowItem,InfinityClockItem,InfinityCrossBowItem,InfinityHoeItem,InfinityPickaxeItem,InfinityShovelItem,InfinitySwordItem,InfinityTridentItem,InfinityUmbrellaItem
public interface ISwitchable
-
方法概要
修饰符和类型方法说明default voidcycleMode(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, List<String> modeList) 循环切换模式static intgetCurrentMode(net.minecraft.world.item.ItemStack stack, List<String> modeList) 获取当前激活的模式default intgetCurrentModeIndex(net.minecraft.world.item.ItemStack stack, List<String> modeList) 获取当前激活的模式(实例方法)default boolean检查指定功能是否处于激活状态(实例方法)static boolean检查指定功能是否处于激活状态default void设置指定模式为激活状态default voidswitchMode(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand, String funcName) 保持原有的单功能切换方法(向后兼容)default voidswitchToMode(@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
检查指定功能是否处于激活状态- 参数:
stack- 物品堆funcName- 功能名称- 返回:
- 是否激活
-
isActive
检查指定功能是否处于激活状态(实例方法)- 参数:
stack- 物品堆funcName- 功能名称- 返回:
- 是否激活
-
getCurrentMode
获取当前激活的模式- 参数:
stack- 物品堆modeList- 模式列表- 返回:
- 当前模式索引,-1表示无激活模式
-
getCurrentModeIndex
获取当前激活的模式(实例方法)- 参数:
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- 功能名称
-