Search in sources :

Example 1 with BleachSubscribe

use of org.bleachhack.eventbus.BleachSubscribe in project BleachHack by BleachDrinker420.

the class NotebotStealer method onSoundPlay.

@BleachSubscribe
public void onSoundPlay(EventSoundPlay.Normal event) {
    if (event.getInstance().getId().getPath().contains("note_block")) {
        int type = 0;
        int note = 0;
        for (int n = 0; n < 25; n++) {
            if ((float) Math.pow(2.0D, (n - 12) / 12.0D) - 0.01 < event.getInstance().getPitch() && (float) Math.pow(2.0D, (n - 12) / 12.0D) + 0.01 > event.getInstance().getPitch()) {
                note = n;
                break;
            }
        }
        if (event.getInstance().getId().getPath().contains("basedrum"))
            type = 1;
        else if (event.getInstance().getId().getPath().contains("snare"))
            type = 2;
        else if (event.getInstance().getId().getPath().contains("hat"))
            type = 3;
        else if (event.getInstance().getId().getPath().contains("bass"))
            type = 4;
        else if (event.getInstance().getId().getPath().contains("flute"))
            type = 5;
        else if (event.getInstance().getId().getPath().contains("bell"))
            type = 6;
        else if (event.getInstance().getId().getPath().contains("guitar"))
            type = 7;
        else if (event.getInstance().getId().getPath().contains("chime"))
            type = 8;
        else if (event.getInstance().getId().getPath().contains("xylophone"))
            type = 9;
        else if (event.getInstance().getId().getPath().contains("iron_xylophone"))
            type = 10;
        else if (event.getInstance().getId().getPath().contains("cow_bell"))
            type = 11;
        else if (event.getInstance().getId().getPath().contains("didgeridoo"))
            type = 12;
        else if (event.getInstance().getId().getPath().contains("bit"))
            type = 13;
        else if (event.getInstance().getId().getPath().contains("banjo"))
            type = 14;
        else if (event.getInstance().getId().getPath().contains("pling"))
            type = 15;
        notes.put(ticks, new Note(note, type));
    }
}
Also used : Note(org.bleachhack.module.mods.Notebot.Note) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Example 2 with BleachSubscribe

use of org.bleachhack.eventbus.BleachSubscribe in project BleachHack by BleachDrinker420.

the class PacketFly method onReadPacket.

@BleachSubscribe
public void onReadPacket(EventPacket.Read event) {
    if (event.getPacket() instanceof PlayerPositionLookS2CPacket) {
        PlayerPositionLookS2CPacket p = (PlayerPositionLookS2CPacket) event.getPacket();
        p.yaw = mc.player.getYaw();
        p.pitch = mc.player.getPitch();
        if (getSetting(4).asToggle().getState()) {
            event.setCancelled(true);
        }
    }
}
Also used : PlayerPositionLookS2CPacket(net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Example 3 with BleachSubscribe

use of org.bleachhack.eventbus.BleachSubscribe in project BleachHack by BleachDrinker420.

the class PacketFly method onSendPacket.

@BleachSubscribe
public void onSendPacket(EventPacket.Send event) {
    if (event.getPacket() instanceof PlayerMoveC2SPacket.LookAndOnGround) {
        event.setCancelled(true);
        return;
    }
    if (event.getPacket() instanceof PlayerMoveC2SPacket.Full) {
        event.setCancelled(true);
        PlayerMoveC2SPacket p = (PlayerMoveC2SPacket) event.getPacket();
        mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.getX(0), p.getY(0), p.getZ(0), p.isOnGround()));
    }
}
Also used : PlayerMoveC2SPacket(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Example 4 with BleachSubscribe

use of org.bleachhack.eventbus.BleachSubscribe in project BleachHack by BleachDrinker420.

the class PacketFly method onTick.

@BleachSubscribe
public void onTick(EventTick event) {
    if (!mc.player.isAlive())
        return;
    double hspeed = getSetting(1).asSlider().getValue();
    double vspeed = getSetting(2).asSlider().getValue();
    timer++;
    Vec3d forward = new Vec3d(0, 0, hspeed).rotateY(-(float) Math.toRadians(mc.player.getYaw()));
    Vec3d moveVec = Vec3d.ZERO;
    if (mc.player.input.pressingForward) {
        moveVec = moveVec.add(forward);
    }
    if (mc.player.input.pressingBack) {
        moveVec = moveVec.add(forward.negate());
    }
    if (mc.player.input.jumping) {
        moveVec = moveVec.add(0, vspeed, 0);
    }
    if (mc.player.input.sneaking) {
        moveVec = moveVec.add(0, -vspeed, 0);
    }
    if (mc.player.input.pressingLeft) {
        moveVec = moveVec.add(forward.rotateY((float) Math.toRadians(90)));
    }
    if (mc.player.input.pressingRight) {
        moveVec = moveVec.add(forward.rotateY((float) -Math.toRadians(90)));
    }
    Entity target = mc.player.getRootVehicle();
    if (getSetting(0).asMode().getMode() == 0) {
        if (timer > getSetting(3).asSlider().getValue()) {
            moveVec = moveVec.add(0, -vspeed, 0);
            timer = 0;
        }
        cachedPos = cachedPos.add(moveVec);
        // target.noClip = true;
        target.updatePositionAndAngles(cachedPos.x, cachedPos.y, cachedPos.z, mc.player.getYaw(), mc.player.getPitch());
        if (target != mc.player) {
            mc.player.networkHandler.sendPacket(new VehicleMoveC2SPacket(target));
        } else {
            mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(cachedPos.x, cachedPos.y, cachedPos.z, false));
            mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(cachedPos.x, cachedPos.y - 0.01, cachedPos.z, true));
        }
    } else if (getSetting(0).asMode().getMode() == 1) {
        if (timer > getSetting(3).asSlider().getValue()) {
            moveVec = new Vec3d(0, -vspeed, 0);
            timer = 0;
        }
        mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX() + moveVec.x, mc.player.getY() + moveVec.y, mc.player.getZ() + moveVec.z, false));
        mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX() + moveVec.x, mc.player.getY() - 420.69, mc.player.getZ() + moveVec.z, true));
    }
}
Also used : Entity(net.minecraft.entity.Entity) VehicleMoveC2SPacket(net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket) PlayerMoveC2SPacket(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket) Vec3d(net.minecraft.util.math.Vec3d) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Example 5 with BleachSubscribe

use of org.bleachhack.eventbus.BleachSubscribe in project BleachHack by BleachDrinker420.

the class PlayerCrash method onTick.

@BleachSubscribe
public void onTick(EventTick event) {
    for (int i = 0; i < getSetting(0).asSlider().getValue(); i++) {
        mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(Math.random() >= 0.5));
        mc.player.networkHandler.sendPacket(new KeepAliveC2SPacket((int) (Math.random() * 8)));
    }
}
Also used : KeepAliveC2SPacket(net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket) PlayerMoveC2SPacket(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Aggregations

BleachSubscribe (org.bleachhack.eventbus.BleachSubscribe)79 BlockPos (net.minecraft.util.math.BlockPos)26 Vec3d (net.minecraft.util.math.Vec3d)24 Entity (net.minecraft.entity.Entity)12 PlayerMoveC2SPacket (net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket)12 Box (net.minecraft.util.math.Box)12 SettingToggle (org.bleachhack.setting.module.SettingToggle)12 Module (org.bleachhack.module.Module)10 BlockHitResult (net.minecraft.util.hit.BlockHitResult)9 ModuleCategory (org.bleachhack.module.ModuleCategory)9 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 Direction (net.minecraft.util.math.Direction)8 ItemStack (net.minecraft.item.ItemStack)7 Hand (net.minecraft.util.Hand)7 EventTick (org.bleachhack.event.events.EventTick)7 SettingSlider (org.bleachhack.setting.module.SettingSlider)6 ArrayList (java.util.ArrayList)5 Items (net.minecraft.item.Items)5 ClientCommandC2SPacket (net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket)5 QuadColor (org.bleachhack.util.render.color.QuadColor)5