Merge pull request #143 from blockparole/fastbow

added seppukus FastBow
This commit is contained in:
Ridan Vandenbergh 2019-11-24 23:30:33 +01:00 committed by GitHub
commit 91d6237eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package me.zeroeightsix.kami.module.modules.combat;
import me.zeroeightsix.kami.module.Module;
import net.minecraft.network.play.client.CPacketPlayerDigging;
import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
import net.minecraft.util.math.BlockPos;
/**
* Author Seth 4/30/2019 @ 4:27 AM.
* <p>
* see <a href=" https://github.com/seppukudevelopment/seppuku/blob/558636579c2c2df5941525d9af1f6e5a4ef658cc/src/main/java/me/rigamortis/seppuku/impl/module/combat/FastBowModule.java">github.com/seppukudevelopment/seppuku</a>
*/
@Module.Info(name = "FastBow", description = "Fast Bow Release", category = Module.Category.COMBAT)
public class FastBow extends Module {
@Override
public void onUpdate() {
if (mc.player.inventory.getCurrentItem().getItem() instanceof net.minecraft.item.ItemBow &&
mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) {
mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing()));
mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand()));
mc.player.stopActiveHand();
}
}
}