This commit is contained in:
Flanks255 2024-12-07 11:53:56 -06:00
parent 690aa4bc17
commit c10862ce02
4 changed files with 7 additions and 22 deletions

View file

@ -72,12 +72,12 @@ public class DrillItem extends ItemEnergy {
attributes_unpowered = ItemAttributeModifiers.builder() 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_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(); .build();
attributes_powered = ItemAttributeModifiers.builder() 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_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(); .build();
} }

View file

@ -34,7 +34,7 @@ public class ItemBattery extends ItemEnergy {
} }
@Override @Override
public boolean isFoil(ItemStack stack) { public boolean isFoil(@Nonnull ItemStack stack) {
return ItemUtil.isEnabled(stack); return ItemUtil.isEnabled(stack);
} }

View file

@ -31,7 +31,7 @@ public class ItemMagnetRing extends ItemEnergy {
} }
@Override @Override
public boolean isFoil(ItemStack stack) { public boolean isFoil(@Nonnull ItemStack stack) {
return !ItemUtil.isEnabled(stack); return !ItemUtil.isEnabled(stack);
} }

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items.base; 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.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage; import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
@ -58,12 +57,12 @@ public abstract class ItemEnergy extends ItemBase {
} }
@Override @Override
public boolean isFoil(ItemStack stack) { public boolean isFoil(@Nonnull ItemStack stack) {
return false; return false;
} }
@Override @Override
public boolean isBarVisible(ItemStack itemStack) { public boolean isBarVisible(@Nonnull ItemStack itemStack) {
return true; return true;
} }
@ -77,7 +76,7 @@ public abstract class ItemEnergy extends ItemBase {
} }
@Override @Override
public int getBarColor(ItemStack stack) { public int getBarColor(@Nonnull ItemStack stack) {
int defaultColor = super.getBarColor(stack); int defaultColor = super.getBarColor(stack);
if (FMLEnvironment.dist.isClient()) { if (FMLEnvironment.dist.isClient()) {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getInstance();
@ -136,20 +135,6 @@ public abstract class ItemEnergy extends ItemBase {
.orElse(0); .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 // @Override TODO: Register Energy cap/attachment
// public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { // public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) {
// return new EnergyCapabilityProvider(stack, this); // return new EnergyCapabilityProvider(stack, this);