Skip to content

Commit

Permalink
idk how tf he got that error but try catch ig
Browse files Browse the repository at this point in the history
  • Loading branch information
freebonsai committed Oct 5, 2023
1 parent 28d9f27 commit 53403c5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/kotlin/me/odinclient/features/impl/dungeon/SuperBoom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ object SuperBoom : Module(
val lookingAt = mc.objectMouseOver ?: return
if (lookingAt.typeOfHit != net.minecraft.util.MovingObjectPosition.MovingObjectType.BLOCK) return
val blockState = mc.theWorld?.getBlockState(lookingAt.blockPos) ?: return
val sideHit = lookingAt.sideHit ?: return
val block = blockState.block
if (
block.damageDropped(blockState) != 2 &&
Expand All @@ -51,11 +52,15 @@ object SuperBoom : Module(
}
val previousItemIndex = mc.thePlayer.inventory.currentItem

mc.netHandler.addToSendQueue(C09PacketHeldItemChange(superboomIndex))
mc.thePlayer.inventory.currentItem = superboomIndex
mc.playerController.clickBlock(lookingAt.blockPos, lookingAt.sideHit)
mc.netHandler.addToSendQueue(C09PacketHeldItemChange(previousItemIndex))
mc.thePlayer.inventory.currentItem = previousItemIndex
try {
mc.netHandler.addToSendQueue(C09PacketHeldItemChange(superboomIndex))
mc.thePlayer.inventory.currentItem = superboomIndex
mc.playerController.clickBlock(lookingAt.blockPos, sideHit)
mc.netHandler.addToSendQueue(C09PacketHeldItemChange(previousItemIndex))
mc.thePlayer.inventory.currentItem = previousItemIndex
} catch (e: Exception) {
e.printStackTrace()
}

lastclick = System.currentTimeMillis()
}
Expand Down

0 comments on commit 53403c5

Please sign in to comment.