添加abk的耐久条

This commit is contained in:
17146 2025-05-18 18:42:02 +08:00 committed by Light_Quanta
parent da05fdecc9
commit fb68638ee7
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -36,13 +36,8 @@ public class HomemadeShotgunItem extends GunItem implements GeoItem {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
@Override
public Set<SoundEvent> getReloadSound() {
return Set.of(ModSounds.HOMEMADE_SHOTGUN_RELOAD_EMPTY.get(), ModSounds.HOMEMADE_SHOTGUN_NORMAL.get());
}
public HomemadeShotgunItem() {
super(new Properties().durability(24).rarity(Rarity.COMMON));
super(new Item.Properties().durability(24).rarity(Rarity.COMMON));
}
@Override
@ -51,17 +46,22 @@ public class HomemadeShotgunItem extends GunItem implements GeoItem {
}
@Override
public int getBarWidth(@NotNull ItemStack stack) {
return Math.round(13.0F - (float) stack.getDamageValue() * 13.0F / (float) this.getMaxDamage(stack));
public int getBarWidth(ItemStack pStack) {
return Math.round(13.0F - (float) pStack.getDamageValue() * 13.0F / (float) this.getMaxDamage(pStack));
}
@Override
public int getBarColor(@NotNull ItemStack stack) {
float stackMaxDamage = (float) this.getMaxDamage(stack);
float f = Math.max(0.0F, (stackMaxDamage - (float) stack.getDamageValue()) / stackMaxDamage);
public int getBarColor(@NotNull ItemStack pStack) {
float stackMaxDamage = this.getMaxDamage(pStack);
float f = Math.max(0.0F, (stackMaxDamage - (float) pStack.getDamageValue()) / stackMaxDamage);
return Mth.hsvToRgb(f / 3.0F, 1.0F, 1.0F);
}
@Override
public Set<SoundEvent> getReloadSound() {
return Set.of(ModSounds.HOMEMADE_SHOTGUN_RELOAD_EMPTY.get(), ModSounds.HOMEMADE_SHOTGUN_NORMAL.get());
}
@Override
public Supplier<GeoItemRenderer<? extends Item>> getRenderer() {
return HomemadeShotgunItemRenderer::new;