use of com.tangykiwi.kiwiclient.mixin.ClientPlayerInteractionManagerAccessor in project KiwiClient by TangyKiwi.
the class AutoTool method onTick.
@Subscribe
public void onTick(TickEvent event) {
ClientPlayerInteractionManager interactionManager = mc.interactionManager;
if (prevState == true && !interactionManager.isBreakingBlock()) {
mc.player.getInventory().selectedSlot = slot;
} else if (prevState != interactionManager.isBreakingBlock()) {
slot = mc.player.getInventory().selectedSlot;
}
if (interactionManager.isBreakingBlock()) {
BlockPos blockPos = ((ClientPlayerInteractionManagerAccessor) interactionManager).getCurrentBreakingPos();
BlockState blockState = mc.world.getBlockState(blockPos);
swap(blockState);
}
prevState = interactionManager.isBreakingBlock();
}
Aggregations