Search in sources :

Example 1 with EventClientMove

use of org.bleachhack.event.events.EventClientMove in project BleachHack by BleachDrinker420.

the class MixinClientPlayerEntity method move.

@Inject(method = "move", at = @At("HEAD"), cancellable = true)
private void move(MovementType type, Vec3d movement, CallbackInfo info) {
    EventClientMove event = new EventClientMove(type, movement);
    BleachHack.eventBus.post(event);
    if (event.isCancelled()) {
        info.cancel();
    } else if (!type.equals(event.getType()) || !movement.equals(event.getVec())) {
        double double_1 = this.getX();
        double double_2 = this.getZ();
        super.move(event.getType(), event.getVec());
        this.autoJump((float) (this.getX() - double_1), (float) (this.getZ() - double_2));
        info.cancel();
    }
}
Also used : EventClientMove(org.bleachhack.event.events.EventClientMove) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

EventClientMove (org.bleachhack.event.events.EventClientMove)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1