Skip to content

Commit 42ab349

Browse files
committed
simplify discharging code for omnitool
1 parent abc0d1c commit 42ab349

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/net/neganote/gtutilities/common/item/OmniToolItem.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
4848

4949
// Effectively insta-mines
5050
@Override
51-
5251
public float getDestroySpeed(ItemStack pStack, BlockState pState) {
5352
var electricItem = Objects.requireNonNull(GTCapabilityHelper.getElectricItem(pStack));
5453

@@ -67,7 +66,7 @@ public boolean mineBlock(@NotNull ItemStack pStack, @NotNull Level pLevel, @NotN
6766

6867
var electricItem = Objects.requireNonNull(GTCapabilityHelper.getElectricItem(pStack));
6968

70-
if (electricItem.discharge(GTValues.VEX[tier], tier, true, false, true) == GTValues.VEX[tier]) {
69+
if (electricItem.getCharge() >= GTValues.VEX[tier]) {
7170
// Only discharge if possible to discharge the full amount
7271
electricItem.discharge(GTValues.VEX[tier], tier, true, false, false);
7372
return true;

0 commit comments

Comments
 (0)