类 ToolUtils

java.lang.Object
committee.nova.mods.avaritia.util.ToolUtils

public class ToolUtils extends Object
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>>
     
    static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>>
     
    static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>>
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static void
    accelerateBlockEntity(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity be, int times)
    加速方块实体和更新
    static void
    aoeAttack(net.minecraft.world.entity.player.Player player, float range, float damage, boolean hurtAnimal, boolean lightOn)
    范围攻击
    static void
    arrowBarrage(net.minecraft.world.entity.Entity shooter, net.minecraft.world.level.Level level, List<net.minecraft.world.entity.Entity> piercedAndKilledEntities, net.minecraft.world.entity.projectile.AbstractArrow.Pickup pickup, net.minecraft.util.RandomSource randy, net.minecraft.core.BlockPos pos)
    召唤箭
    static boolean
    canHarvest(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world)
    Axe
    static boolean
    canUseTool(net.minecraft.world.level.block.state.BlockState state, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> keySets)
    Common
    static void
    destroy(net.minecraft.server.level.ServerLevel world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos)
    破坏方块
    static void
    destroyMaterialBlocks(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos startPos, int range, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> materials)
    无尽镐And无尽铲破坏
    static void
    destroyTree(net.minecraft.world.entity.player.Player player, net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    连锁砍树
    static net.minecraft.world.damagesource.DamageSource
    getArrowDamageSource(net.minecraft.world.level.Level level, net.minecraft.world.entity.projectile.AbstractArrow arrow, net.minecraft.world.entity.Entity owner, net.minecraft.world.entity.Entity target)
     
    static net.minecraft.world.item.ItemStack
    getMeltingItem(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.item.ItemStack tool)
    获取物品烧炼后产物
    static net.minecraft.world.item.ItemStack
    getPlayerTotemItem(net.minecraft.world.entity.player.Player player)
    获取玩家背包中的图腾
    static void
    infinityTraceArrowDamage(net.minecraft.world.level.Level level, @NotNull net.minecraft.world.phys.EntityHitResult result, TraceArrowEntity arrow)
    追踪箭
    static boolean
    isInfinite(net.minecraft.world.entity.LivingEntity player)
    身穿全套无尽装备
    static boolean
    isPlayerWearing(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.entity.EquipmentSlot slot, Predicate<net.minecraft.world.item.Item> predicate)
    是否穿着
    static void
    melting(net.minecraft.world.level.block.Block block, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack tool, net.minecraftforge.event.level.BlockEvent.BreakEvent event)
    炽热 自动识别可进行的熔炉配方进行处理(如:原矿-矿物锭)
    static void
    meltingAchieve(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraftforge.event.level.BlockEvent.BreakEvent event)
    熔炼附魔的伪实现 通过取消方块破坏事件,同时生成掉落物
    static void
    pearlAttack(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world)
    终望珍珠攻击
    static void
    rangeBonemealable(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.core.BlockPos blockPos, int rang, int height, int cost)
    范围催熟
    static void
    rangeHarvest(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.core.BlockPos blockPos, int rang, int height)
    范围收获
    static void
    removeBlockWithDrops(net.minecraft.server.level.ServerLevel world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, Set<net.minecraft.world.item.ItemStack> drops, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> validMaterials)
     
    static void
    shootBladeSlash(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
    发射剑气
    static void
    speedBlockTick(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level, int speed, int randomTicks)
    已过时。
    static void
    sweepAttack(net.minecraft.world.level.Level level, net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.Entity victim)
    横扫攻击
    static boolean
    trySummonLightning(net.minecraft.world.level.Level level, int bolts, net.minecraft.core.BlockPos hitPos, @Nullable net.minecraft.server.level.ServerPlayer thrower)
    尝试在指定位置召唤闪电

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • materialsPick

      public static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> materialsPick
    • materialsAxe

      public static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> materialsAxe
    • materialsShovel

      public static final Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> materialsShovel
  • 构造器详细资料

    • ToolUtils

      public ToolUtils()
  • 方法详细资料

    • canUseTool

      public static boolean canUseTool(net.minecraft.world.level.block.state.BlockState state, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> keySets)
      Common
    • destroy

      public static void destroy(net.minecraft.server.level.ServerLevel world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos)
      破坏方块
      参数:
      world - 世界
      player - 玩家
      pos - 点击坐标
    • isPlayerWearing

      public static boolean isPlayerWearing(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.entity.EquipmentSlot slot, Predicate<net.minecraft.world.item.Item> predicate)
      是否穿着
      参数:
      entity - 生物
      slot - 装备槽
      predicate - 过滤
      返回:
      是否穿着
    • isInfinite

      public static boolean isInfinite(net.minecraft.world.entity.LivingEntity player)
      身穿全套无尽装备
      参数:
      player - 玩家
      返回:
      是否身穿全套无尽装备
    • destroyMaterialBlocks

      public static void destroyMaterialBlocks(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos startPos, int range, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> materials)
      无尽镐And无尽铲破坏
      参数:
      player - 玩家
      startPos - 起始坐标
      range - 挖掘范围
    • removeBlockWithDrops

      public static void removeBlockWithDrops(net.minecraft.server.level.ServerLevel world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, Set<net.minecraft.world.item.ItemStack> drops, Set<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> validMaterials)
    • arrowBarrage

      public static void arrowBarrage(net.minecraft.world.entity.Entity shooter, net.minecraft.world.level.Level level, List<net.minecraft.world.entity.Entity> piercedAndKilledEntities, net.minecraft.world.entity.projectile.AbstractArrow.Pickup pickup, net.minecraft.util.RandomSource randy, net.minecraft.core.BlockPos pos)
      召唤箭
      参数:
      shooter - 攻击者
      level - 世界
      piercedAndKilledEntities - 无视护甲的实体
      pickup - 拾起箭
      randy - 随机
      pos - 击中坐标
    • getArrowDamageSource

      public static net.minecraft.world.damagesource.DamageSource getArrowDamageSource(net.minecraft.world.level.Level level, net.minecraft.world.entity.projectile.AbstractArrow arrow, net.minecraft.world.entity.Entity owner, net.minecraft.world.entity.Entity target)
    • infinityTraceArrowDamage

      public static void infinityTraceArrowDamage(net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.world.phys.EntityHitResult result, TraceArrowEntity arrow)
      追踪箭
      参数:
      result - 命中结果
      arrow - 弓箭
    • sweepAttack

      public static void sweepAttack(net.minecraft.world.level.Level level, net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.Entity victim)
      横扫攻击
      参数:
      level - 世界
      livingEntity - 玩家
      victim - 被攻击者
    • pearlAttack

      public static void pearlAttack(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world)
      终望珍珠攻击
      参数:
      player - 玩家
      stack - Pearl
      world - 世界
    • aoeAttack

      public static void aoeAttack(net.minecraft.world.entity.player.Player player, float range, float damage, boolean hurtAnimal, boolean lightOn)
      范围攻击
      参数:
      player - 玩家
      range - 范围
      damage - 伤害
      hurtAnimal - 是否攻击动物
      lightOn - 使用闪电
    • trySummonLightning

      public static boolean trySummonLightning(net.minecraft.world.level.Level level, int bolts, net.minecraft.core.BlockPos hitPos, @Nullable @Nullable net.minecraft.server.level.ServerPlayer thrower)
      尝试在指定位置召唤闪电
      参数:
      level - 世界对象,用于创建和添加实体
      bolts - 生成的闪电数量
      hitPos - 闪电生成的位置
      thrower - 可为空的服务器玩家对象,作为闪电的施放者
      返回:
      如果成功生成至少一个闪电则返回true,否则返回false
    • rangeHarvest

      public static void rangeHarvest(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.core.BlockPos blockPos, int rang, int height)
      范围收获
      参数:
      serverLevel - 世界
      player - 玩家
      stack - 使用工具
      blockPos - 点击位置
      rang - 范围
      height - 高度
    • rangeBonemealable

      public static void rangeBonemealable(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.core.BlockPos blockPos, int rang, int height, int cost)
      范围催熟
      参数:
      serverLevel - 世界
      blockPos - 点击位置
      rang - 范围
      height - 高度
      cost - 次数
    • canHarvest

      public static boolean canHarvest(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world)
      Axe
    • destroyTree

      public static void destroyTree(net.minecraft.world.entity.player.Player player, net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      连锁砍树
      参数:
      player - 玩家
      world - 世界
      pos - 点击坐标
      state - 方块状态
    • getPlayerTotemItem

      public static net.minecraft.world.item.ItemStack getPlayerTotemItem(net.minecraft.world.entity.player.Player player)
      获取玩家背包中的图腾
      参数:
      player - 玩家
      返回:
      图腾
    • melting

      public static void melting(net.minecraft.world.level.block.Block block, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack tool, net.minecraftforge.event.level.BlockEvent.BreakEvent event)
      炽热 自动识别可进行的熔炉配方进行处理(如:原矿-矿物锭)
      参数:
      block - 原矿方块
      state - 原矿状态
      world - 世界
      pos - 点击坐标
      player - 玩家
      tool - 使用的工具
      event - 破坏事件
    • getMeltingItem

      public static net.minecraft.world.item.ItemStack getMeltingItem(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.item.ItemStack tool)
      获取物品烧炼后产物
      参数:
      world - world
      itemStack - 烧炼前物品
      tool - 使用工具
      返回:
      烧炼产物
    • meltingAchieve

      public static void meltingAchieve(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraftforge.event.level.BlockEvent.BreakEvent event)
      熔炼附魔的伪实现 通过取消方块破坏事件,同时生成掉落物
      参数:
      world - 世界
      player - 玩家
      pos - 坐标
      event - 事件 from ...
    • shootBladeSlash

      public static void shootBladeSlash(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
      发射剑气
      参数:
      stack - 工具
      player - 玩家
    • speedBlockTick

      @Deprecated public static void speedBlockTick(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level, int speed, int randomTicks)
      已过时。
      加速方块实体和更新
      参数:
      pos - 被加速方块位置
      level - 世界
      speed - 速度
      randomTicks - 随机刻 from Torcherino 已弃用
    • accelerateBlockEntity

      public static void accelerateBlockEntity(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity be, int times)
      加速方块实体和更新
      参数:
      level - 世界
      pos - 被加速方块位置
      be - 被加速的实体
      times - 随机刻