use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.
the class TargetStrafe method onRender3D.
@EventTarget
public final void onRender3D(EventRender3D event) {
if (Killaura.target != null)
this.setDisplayName("TargetStrafe " + ColorUtils.gray + Killaura.target.getName().getString());
else
this.setDisplayName("TargetStrafe " + ColorUtils.gray + "None");
if (ModuleManager.INSTANCE.getModule(Killaura.class).isEnabled() && Killaura.target != null) {
LivingEntity target = Killaura.target;
drawCircle(event.getMatrices(), target, event.getTickDelta(), radius.getValue(), 0.1);
}
}
use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.
the class Velocity method onReceivePacket.
@EventTarget
public void onReceivePacket(EventReceivePacket event) {
if (mc.world == null || mc.player == null)
return;
this.setDisplayName("Velocity " + ColorUtils.gray + "H:" + horizontal.getValue() + " V:" + vertical.getValue());
if (event.getPacket() instanceof EntityVelocityUpdateS2CPacket) {
EntityVelocityUpdateS2CPacket velocity = (EntityVelocityUpdateS2CPacket) event.getPacket();
if (velocity.getId() == mc.player.getId() && !mc.player.isTouchingWater()) {
ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityX() * (horizontal.getValue() * 0.01)), "velocityX", "field_12561");
ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityY() * (vertical.getValue() * 0.01)), "velocityY", "field_12562");
ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityZ() * (horizontal.getValue() * 0.01)), "velocityZ", "field_12563");
}
} else if (event.getPacket() instanceof ExplosionS2CPacket) {
ExplosionS2CPacket velocity = (ExplosionS2CPacket) event.getPacket();
ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityX() * (horizontal.getValue() * 0.01)), "playerVelocityX", "field_12176");
ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityY() * (vertical.getValue() * 0.01)), "playerVelocityY", "field_12183");
ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityZ() * (horizontal.getValue() * 0.01)), "playerVelocityZ", "field_12182");
}
}
use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.
the class ResourcePackSpoof method onReceivePacket.
@EventTarget
public void onReceivePacket(EventReceivePacket event) {
if (mc.player != null && mc.player.networkHandler != null && event.getPacket() instanceof ResourcePackSendS2CPacket) {
mc.player.networkHandler.sendPacket(new ResourcePackStatusC2SPacket(Status.ACCEPTED));
mc.player.networkHandler.sendPacket(new ResourcePackStatusC2SPacket(Status.SUCCESSFULLY_LOADED));
}
}
use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.
the class ElytraFly method onMotion.
@EventTarget
public void onMotion(EventMove event) {
this.setDisplayName("ElytraFly " + ColorUtils.gray + mode.getSelected());
if (wearingElytra() && (autoElytra.isEnabled() && mc.player.fallDistance >= fallDistance.getValue() && !mc.player.isOnGround() && !mc.player.isFallFlying())) {
if (mc.player.age % 5 == 0)
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_FALL_FLYING));
}
if (mc.player.isFallFlying()) {
if (mode.is("Firework")) {
Vec3d vec3d_1 = mc.player.getRotationVector();
// double double_1 = 1.5D;
Vec3d vec3d_2 = mc.player.getVelocity();
mc.player.setVelocity(vec3d_2.add(vec3d_1.x * 0.1D + (vec3d_1.x * 1.5D - vec3d_2.x) * 0.5D, vec3d_1.y * 0.1D + (vec3d_1.y * 1.5D - vec3d_2.y) * 0.5D, vec3d_1.z * 0.1D + (vec3d_1.z * 1.5D - vec3d_2.z) * 0.5D));
} else {
if (mode.is("NCP") || mode.is("Vanilla")) {
PlayerUtils.setMoveSpeed(event, flySpeed.getValue());
if (event.getY() <= 0)
event.setY(mc.player.isSneaking() ? (float) -downSpeed.getValue() : (slowGlide.isEnabled() ? -0.01 : 0));
if (mode.is("Vanilla")) {
if (mc.options.jumpKey.isPressed())
event.setY(flySpeed.getValue());
if (mc.options.sneakKey.isPressed())
event.setY(-flySpeed.getValue());
}
}
}
}
}
use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.
the class Search method receivePacket.
@EventTarget
public void receivePacket(EventReceivePacket event) {
if (event.getPacket() instanceof DisconnectS2CPacket || event.getPacket() instanceof GameJoinS2CPacket || event.getPacket() instanceof PlayerRespawnS2CPacket) {
reset();
} else if (event.getPacket() instanceof BlockUpdateS2CPacket) {
BlockUpdateS2CPacket packet = (BlockUpdateS2CPacket) event.getPacket();
queuedBlocks.add(Pair.of(packet.getPos(), packet.getState()));
} else if (event.getPacket() instanceof ExplosionS2CPacket) {
ExplosionS2CPacket packet = (ExplosionS2CPacket) event.getPacket();
for (BlockPos pos : packet.getAffectedBlocks()) {
queuedBlocks.add(Pair.of(pos, Blocks.AIR.getDefaultState()));
}
} else if (event.getPacket() instanceof ChunkDeltaUpdateS2CPacket) {
ChunkDeltaUpdateS2CPacket packet = (ChunkDeltaUpdateS2CPacket) event.getPacket();
packet.visitUpdates((pos, state) -> queuedBlocks.add(Pair.of(pos.toImmutable(), state)));
} else if (event.getPacket() instanceof ChunkDataS2CPacket) {
ChunkDataS2CPacket packet = (ChunkDataS2CPacket) event.getPacket();
ChunkPos cp = new ChunkPos(packet.getX(), packet.getZ());
queuedChunks.add(cp);
queuedUnloads.remove(cp);
} else if (event.getPacket() instanceof UnloadChunkS2CPacket) {
UnloadChunkS2CPacket packet = (UnloadChunkS2CPacket) event.getPacket();
queuedUnloads.add(new ChunkPos(packet.getX(), packet.getZ()));
}
}
Aggregations