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));
}
}
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);
}
}
}
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()));
}
}
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));
}
}
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)));
}
}
Aggregations