From c10862ce02bc2566d7d49aabb37ae6aba9154bef Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:53:56 -0600 Subject: [PATCH] Tweaks --- .../mod/items/DrillItem.java | 4 ++-- .../mod/items/ItemBattery.java | 2 +- .../mod/items/ItemMagnetRing.java | 2 +- .../mod/items/base/ItemEnergy.java | 21 +++---------------- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java index b26502066..76eaf5083 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java @@ -72,12 +72,12 @@ public class DrillItem extends ItemEnergy { attributes_unpowered = ItemAttributeModifiers.builder() .add(Attributes.ATTACK_DAMAGE, new AttributeModifier(ActuallyAdditions.modLoc("drill_attack"), 0.1F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) - .add(Attributes.ATTACK_SPEED, new AttributeModifier(ActuallyAdditions.modLoc("drill_speed"), 1.5F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + .add(Attributes.ATTACK_SPEED, new AttributeModifier(ActuallyAdditions.modLoc("drill_speed"), 1.0F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) .build(); attributes_powered = ItemAttributeModifiers.builder() .add(Attributes.ATTACK_DAMAGE, new AttributeModifier(ActuallyAdditions.modLoc("drill_attack"), 8.0F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) - .add(Attributes.ATTACK_SPEED, new AttributeModifier(ActuallyAdditions.modLoc("drill_speed"), 1.5F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + .add(Attributes.ATTACK_SPEED, new AttributeModifier(ActuallyAdditions.modLoc("drill_speed"), 1.0F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) .build(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index d59512804..9e236e3fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -34,7 +34,7 @@ public class ItemBattery extends ItemEnergy { } @Override - public boolean isFoil(ItemStack stack) { + public boolean isFoil(@Nonnull ItemStack stack) { return ItemUtil.isEnabled(stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java index ea3b43fcb..af3c13354 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java @@ -31,7 +31,7 @@ public class ItemMagnetRing extends ItemEnergy { } @Override - public boolean isFoil(ItemStack stack) { + public boolean isFoil(@Nonnull ItemStack stack) { return !ItemUtil.isEnabled(stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java index 63897cb1a..4bf3e6a4c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.items.base; -import de.ellpeck.actuallyadditions.mod.components.ActuallyComponents; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -58,12 +57,12 @@ public abstract class ItemEnergy extends ItemBase { } @Override - public boolean isFoil(ItemStack stack) { + public boolean isFoil(@Nonnull ItemStack stack) { return false; } @Override - public boolean isBarVisible(ItemStack itemStack) { + public boolean isBarVisible(@Nonnull ItemStack itemStack) { return true; } @@ -77,7 +76,7 @@ public abstract class ItemEnergy extends ItemBase { } @Override - public int getBarColor(ItemStack stack) { + public int getBarColor(@Nonnull ItemStack stack) { int defaultColor = super.getBarColor(stack); if (FMLEnvironment.dist.isClient()) { Minecraft mc = Minecraft.getInstance(); @@ -136,20 +135,6 @@ public abstract class ItemEnergy extends ItemBase { .orElse(0); } - public int getEnergyStorage(ItemStack stack) { - return stack.getOrDefault(ActuallyComponents.ENERGY_STORAGE, 0); - } - - @Override - public int getMaxDamage(ItemStack stack) { - return getEnergyStorage(stack); - } - - @Override - public boolean isDamageable(ItemStack stack) { - return false; - } - // @Override TODO: Register Energy cap/attachment // public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { // return new EnergyCapabilityProvider(stack, this);