类 GsHelper
java.lang.Object
mod.chloeprime.gunsmithlib.common.util.GsHelper
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static org.luaj.vm2.LuaFunctioncheckFunction(org.luaj.vm2.LuaValue luaValue) static <E extends Enum<E>>
com.mojang.serialization.Codec<E> static doubleevaluateItemAttribute(net.minecraft.world.item.ItemStack item, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attributeHolder, double baseValue) static doublegetAttributeValueWithBase(net.minecraft.world.entity.LivingEntity holder, net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> attribute, double base) static doublegetBuffCoefficient(net.minecraft.resources.ResourceLocation gunId, boolean isMelee) static floatgetCooldownDuration(net.minecraft.world.item.ItemCooldowns cooldowns, net.minecraft.world.item.Item item) static doublegetEstimatedMaxRange(net.minecraft.world.entity.Entity entity, net.minecraft.world.item.ItemStack gunStack) static doublegetEstimatedMaxRange(net.minecraft.world.entity.Entity entity, net.minecraft.world.item.ItemStack gunStack, com.tacz.guns.api.item.IGun gunItem) static int[]static int[]static floatinfDist(cn.chloeprime.commons.lang4.FloatSupplier nextGaussianFunc, float mean, float dev) static doubleinfDist(DoubleSupplier nextGaussianFunc, double mean, double dev) static doubleinfLerp(double delta, double start, double end) static floatinfLerp(float delta, float start, float end) parseStaticFields(Class<?> clazz) static OptionalIntstatic OptionalIntscanBackpackAmmo(net.minecraft.world.entity.player.Player user, GunInfo gun) 精妙背包内的子弹static OptionalIntscanInventoryAmmo(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 voidsyncBulletExplodePos(net.minecraft.world.entity.projectile.Projectile bullet, net.minecraft.world.phys.Vec3 pos) static <T> voidtryRemoveComponent(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)
-
方法详细资料
-
infDist
public static float infDist(cn.chloeprime.commons.lang4.FloatSupplier nextGaussianFunc, float mean, float dev) -
infDist
-
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
-
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
-
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
-
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
- 返回:
- 无限弹药时返回
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)
-