Fixed drill attributes going haywire.

Bumped for release.
This commit is contained in:
Flanks255 2024-06-27 16:59:03 -05:00
parent 9eec468f7c
commit 0ebbd811fd
3 changed files with 20 additions and 9 deletions

View file

@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
# Actually Additions # Actually Additions
mod_version=1.2.13 mod_version=1.2.14
# Forge # Forge
game_version=1.20.4 game_version=1.20.4

View file

@ -62,8 +62,15 @@ public class DrillItem extends ItemEnergy {
private static final int ENERGY_USE = 100; private static final int ENERGY_USE = 100;
private static final List<ToolAction> ACTIONS = List.of(ToolActions.SHOVEL_DIG, ToolActions.PICKAXE_DIG); private static final List<ToolAction> ACTIONS = List.of(ToolActions.SHOVEL_DIG, ToolActions.PICKAXE_DIG);
private final Multimap<Attribute, AttributeModifier> attributes_unpowered = ArrayListMultimap.create();
private final Multimap<Attribute, AttributeModifier> attributes_powered = ArrayListMultimap.create();
public DrillItem() { public DrillItem() {
super(ActuallyItems.defaultProps().defaultDurability(0).stacksTo(1), 250000, 1000); super(ActuallyItems.defaultProps().defaultDurability(0).stacksTo(1), 250000, 1000);
attributes_powered.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Drill Modifier", 8.0F, AttributeModifier.Operation.ADDITION));
attributes_powered.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID,"Tool Modifier", 1.5F, AttributeModifier.Operation.ADDITION));
attributes_unpowered.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Drill Modifier", 0.1F, AttributeModifier.Operation.ADDITION));
attributes_unpowered.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID,"Tool Modifier", 1.5F, AttributeModifier.Operation.ADDITION));
} }
@Override @Override
@ -180,16 +187,13 @@ public class DrillItem extends ItemEnergy {
@Nonnull @Nonnull
@Override @Override
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nonnull EquipmentSlot slot, @Nonnull ItemStack stack) { public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nonnull EquipmentSlot slot, @Nonnull ItemStack stack) {
Multimap<Attribute, AttributeModifier> map = ArrayListMultimap.create();
if (slot == EquipmentSlot.MAINHAND) { if (slot == EquipmentSlot.MAINHAND) {
map.put(Attributes.ATTACK_DAMAGE, new AttributeModifier("Drill Modifier", this.getEnergyStored(stack) >= ENERGY_USE return this.getEnergyStored(stack) >= ENERGY_USE
? 8.0F ? this.attributes_powered
: 0.1F, AttributeModifier.Operation.ADDITION)); : this.attributes_unpowered;
map.put(Attributes.ATTACK_SPEED, new AttributeModifier("Tool Modifier", 1.5F, AttributeModifier.Operation.ADDITION));
} }
else
return map; return super.getDefaultAttributeModifiers(slot);
} }

View file

@ -1,3 +1,10 @@
# 1.2.14+mc1.20.4
* Fixed Drill attributes going haywire.
* Fixed missing Crushing recipes for copper / some others.
* Fixed Hopping item interfaces not rendering properly next to blocks.
* Fixed a broken coffee maker tooltip
* Fixed broken lava factory tooltip.
# 1.2.13+mc1.20.4 # 1.2.13+mc1.20.4
* Beta * Beta
* Massive update porting the mod to 1.20.4 NeoForge from 1.12.2, list is non-exhaustive, and some features may not be implemented yet. * Massive update porting the mod to 1.20.4 NeoForge from 1.12.2, list is non-exhaustive, and some features may not be implemented yet.