记录类 GunInfo
java.lang.Object
java.lang.Record
mod.chloeprime.gunsmithlib.api.util.GunInfo
public record GunInfo(net.minecraft.world.item.ItemStack gunStack, com.tacz.guns.api.item.IGun gunItem, net.minecraft.resources.ResourceLocation gunId, com.tacz.guns.resource.index.CommonGunIndex index)
extends Record
- 另请参阅:
-
构造器概要
构造器构造器说明GunInfo(net.minecraft.world.item.ItemStack gunStack, com.tacz.guns.api.item.IGun gunItem, net.minecraft.resources.ResourceLocation gunId, com.tacz.guns.resource.index.CommonGunIndex index) 创建GunInfo记录类的实例。 -
方法概要
修饰符和类型方法说明voidaddDummyAmmoAmount(int amount) voiddropAllAmmoIncludingBarrel(net.minecraft.world.entity.player.Player user) 卸载所有子弹,包括膛内的 +1 发final boolean指示某个其他对象是否“等于”此对象。intcom.tacz.guns.api.item.gun.FireModeintintnet.minecraft.resources.ResourceLocationgunId()返回gunId记录组件的值。com.tacz.guns.api.item.IGungunItem()返回gunItem记录组件的值。net.minecraft.world.item.ItemStackgunStack()返回gunStack记录组件的值。final inthashCode()返回此对象的哈希代码值。com.tacz.guns.resource.index.CommonGunIndexindex()返回index记录组件的值。of(net.minecraft.world.item.ItemStack gun) voidsetDummyAmmoAmount(int amount) voidsetFireMode(com.tacz.guns.api.item.gun.FireMode fireMode) voidsetTotalAmmo(int value) final StringtoString()返回此记录类的字符串表示形式。
-
构造器详细资料
-
GunInfo
public GunInfo(net.minecraft.world.item.ItemStack gunStack, com.tacz.guns.api.item.IGun gunItem, net.minecraft.resources.ResourceLocation gunId, com.tacz.guns.resource.index.CommonGunIndex index) 创建GunInfo记录类的实例。- 参数:
gunStack-gunStack记录组件的值gunItem-gunItem记录组件的值gunId-gunId记录组件的值index-index记录组件的值
-
-
方法详细资料
-
of
- 从以下版本开始:
- 4.12.0
-
getTotalAmmo
public int getTotalAmmo() -
getTotalMagazineSize
public int getTotalMagazineSize() -
setTotalAmmo
public void setTotalAmmo(int value) - 从以下版本开始:
- 3.2.0
-
dropAllAmmoIncludingBarrel
public void dropAllAmmoIncludingBarrel(net.minecraft.world.entity.player.Player user) 卸载所有子弹,包括膛内的 +1 发 -
getDummyAmmoAmount
public int getDummyAmmoAmount() -
setDummyAmmoAmount
public void setDummyAmmoAmount(int amount) -
addDummyAmmoAmount
public void addDummyAmmoAmount(int amount) -
getFireMode
public com.tacz.guns.api.item.gun.FireMode getFireMode() -
setFireMode
public void setFireMode(@Nullable com.tacz.guns.api.item.gun.FireMode fireMode) -
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)进行比较。 -
gunStack
public net.minecraft.world.item.ItemStack gunStack()返回gunStack记录组件的值。- 返回:
gunStack记录组件的值
-
gunItem
public com.tacz.guns.api.item.IGun gunItem()返回gunItem记录组件的值。- 返回:
gunItem记录组件的值
-
gunId
public net.minecraft.resources.ResourceLocation gunId()返回gunId记录组件的值。- 返回:
gunId记录组件的值
-
index
public com.tacz.guns.resource.index.CommonGunIndex index()返回index记录组件的值。- 返回:
index记录组件的值
-