Fixed a java.lang.IllegalArgumentException being raised in 'all' fastuse mode while the player is a spectator. (#815)

This commit is contained in:
Sorzon 2020-05-12 18:55:15 +02:00 committed by GitHub
parent 1f19ae9c82
commit ed5b9a02b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class Fastuse : Module() {
override fun onUpdate() {
if (mc.player == null) return
if (all.value || bow.value && mc.player.heldItemMainhand.getItem() is ItemBow && mc.player.isHandActive && mc.player.itemInUseMaxCount >= 3) {
if (!mc.player.isSpectator && (all.value || bow.value && mc.player.heldItemMainhand.getItem() is ItemBow && mc.player.isHandActive && mc.player.itemInUseMaxCount >= 3)) {
mc.player.connection.sendPacket(CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.horizontalFacing))
mc.player.connection.sendPacket(CPacketPlayerTryUseItem(mc.player.activeHand))
mc.player.stopActiveHand()