Fix unpowered speed for chainsaw. Closes #2268
This commit is contained in:
parent
d84a0133a4
commit
2407286b58
1 changed files with 4 additions and 2 deletions
|
@ -50,6 +50,7 @@ public class ChainsawItem extends AxeItem implements EnergyHolder, ItemDurabilit
|
||||||
public final int maxCharge;
|
public final int maxCharge;
|
||||||
public final int cost;
|
public final int cost;
|
||||||
public final float poweredSpeed;
|
public final float poweredSpeed;
|
||||||
|
private final float unpoweredSpeed;
|
||||||
public final Item referenceTool;
|
public final Item referenceTool;
|
||||||
public final EnergyTier tier;
|
public final EnergyTier tier;
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ public class ChainsawItem extends AxeItem implements EnergyHolder, ItemDurabilit
|
||||||
this.tier = tier;
|
this.tier = tier;
|
||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
this.poweredSpeed = poweredSpeed;
|
this.poweredSpeed = poweredSpeed;
|
||||||
|
this.unpoweredSpeed = unpoweredSpeed;
|
||||||
this.referenceTool = referenceTool;
|
this.referenceTool = referenceTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +69,9 @@ public class ChainsawItem extends AxeItem implements EnergyHolder, ItemDurabilit
|
||||||
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
|
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
|
||||||
if (Energy.of(stack).getEnergy() >= cost
|
if (Energy.of(stack).getEnergy() >= cost
|
||||||
&& (state.getMaterial() == Material.WOOD)) {
|
&& (state.getMaterial() == Material.WOOD)) {
|
||||||
return this.poweredSpeed;
|
return poweredSpeed;
|
||||||
}
|
}
|
||||||
return super.getMiningSpeedMultiplier(stack, state);
|
return unpoweredSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MiningToolItem
|
// MiningToolItem
|
||||||
|
|
Loading…
Add table
Reference in a new issue