类 GsHelper

java.lang.Object
mod.chloeprime.gunsmithlib.common.util.GsHelper

public class GsHelper extends Object
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static final record 
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static org.luaj.vm2.LuaFunction
    checkFunction(org.luaj.vm2.LuaValue luaValue)
     
    static <E extends Enum<E>>
    com.mojang.serialization.Codec<E>
    enumCodec(Class<E> type)
     
    static double
    evaluateItemAttribute(net.minecraft.world.item.ItemStack item, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attributeHolder, double baseValue)
     
    static double
    getAttributeValueWithBase(net.minecraft.world.entity.LivingEntity holder, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, double base)
     
    static double
    getBuffCoefficient(net.minecraft.resources.ResourceLocation gunId, boolean isMelee)
     
    static float
    getCooldownDuration(net.minecraft.world.item.ItemCooldowns cooldowns, net.minecraft.world.item.Item item)
     
    static double
    getEstimatedMaxRange(net.minecraft.world.entity.Entity entity, net.minecraft.world.item.ItemStack gunStack)
     
    static double
    getEstimatedMaxRange(net.minecraft.world.entity.Entity entity, net.minecraft.world.item.ItemStack gunStack, com.tacz.guns.api.item.IGun gunItem)
     
    static int[]
     
    static int[]
     
    static float
    infDist(cn.chloeprime.commons.lang4.FloatSupplier nextGaussianFunc, float mean, float dev)
     
    static double
    infDist(DoubleSupplier nextGaussianFunc, double mean, double dev)
     
    static double
    infLerp(double delta, double start, double end)
     
    static float
    infLerp(float delta, float start, float end)
     
    static Map<String,Object>
     
    scanAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
     
    scanBackpackAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
    精妙背包内的子弹
    scanInventoryAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
    不包含精妙背包内的子弹
    static <T> com.mojang.serialization.Codec<List<T>>
    selfOrList(com.mojang.serialization.Codec<T> elementCodec)
     
    static void
    syncBulletExplodePos(net.minecraft.world.entity.projectile.Projectile bullet, net.minecraft.world.phys.Vec3 pos)
     
    static <T> void
    tryRemoveComponent(net.minecraft.world.item.ItemStack stack, Supplier<net.minecraft.core.component.DataComponentType<T>> component)
     
    unpack(com.tacz.guns.api.item.IGun gunItem, net.minecraft.world.item.ItemStack gunStack)
     

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

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • infDist

      public static float infDist(cn.chloeprime.commons.lang4.FloatSupplier nextGaussianFunc, float mean, float dev)
    • infDist

      public static double infDist(DoubleSupplier nextGaussianFunc, double mean, double dev)
    • infLerp

      public static float infLerp(float delta, float start, float end)
    • infLerp

      public static double infLerp(double delta, double start, double end)
    • getBuffCoefficient

      public static double getBuffCoefficient(net.minecraft.resources.ResourceLocation gunId, boolean isMelee)
      返回:
      增益倍率,永远不会为 0
      从以下版本开始:
      3.2.0
    • unpack

      public static Optional<GunInfo> unpack(com.tacz.guns.api.item.IGun gunItem, net.minecraft.world.item.ItemStack gunStack)
    • getAttributeValueWithBase

      public static double getAttributeValueWithBase(net.minecraft.world.entity.LivingEntity holder, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, double base)
    • getModVersion

      public static int[] getModVersion()
    • getGameVersion

      public static int[] getGameVersion()
    • parseStaticFields

      public static Map<String,Object> parseStaticFields(Class<?> clazz)
    • getEstimatedMaxRange

      public static double getEstimatedMaxRange(@Nullable net.minecraft.world.entity.Entity entity, @Nonnull net.minecraft.world.item.ItemStack gunStack)
    • getEstimatedMaxRange

      public static double getEstimatedMaxRange(@Nullable net.minecraft.world.entity.Entity entity, @Nonnull net.minecraft.world.item.ItemStack gunStack, @Nonnull com.tacz.guns.api.item.IGun gunItem)
    • getCooldownDuration

      public static float getCooldownDuration(net.minecraft.world.item.ItemCooldowns cooldowns, net.minecraft.world.item.Item item)
    • evaluateItemAttribute

      public static double evaluateItemAttribute(net.minecraft.world.item.ItemStack item, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attributeHolder, double baseValue)
    • enumCodec

      public static <E extends Enum<E>> com.mojang.serialization.Codec<E> enumCodec(Class<E> type)
    • selfOrList

      public static <T> com.mojang.serialization.Codec<List<T>> selfOrList(com.mojang.serialization.Codec<T> elementCodec)
    • syncBulletExplodePos

      public static void syncBulletExplodePos(net.minecraft.world.entity.projectile.Projectile bullet, net.minecraft.world.phys.Vec3 pos)
    • scanAmmo

      public static OptionalInt scanAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
      返回:
      无限弹药时返回 OptionalInt.empty()
    • scanInventoryAmmo

      public static OptionalInt scanInventoryAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
      不包含精妙背包内的子弹
      返回:
      无限弹药时返回 OptionalInt.empty()
    • scanBackpackAmmo

      public static OptionalInt scanBackpackAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun)
      精妙背包内的子弹
      返回:
      无限弹药时返回 OptionalInt.empty()
    • checkFunction

      public static org.luaj.vm2.LuaFunction checkFunction(org.luaj.vm2.LuaValue luaValue)
    • tryRemoveComponent

      public static <T> void tryRemoveComponent(net.minecraft.world.item.ItemStack stack, Supplier<net.minecraft.core.component.DataComponentType<T>> component)