Skip to content

Commit

Permalink
My IQ WAS TOO LOW
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Apr 12, 2024
1 parent c7c64e1 commit 5457ec7
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 57 deletions.
18 changes: 9 additions & 9 deletions src/main/java/net/aspw/client/features/api/McUpdatesHandler.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.aspw.client.features.api;

import net.aspw.client.event.*;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.AnimationUtils;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.render.RenderUtils;
Expand Down Expand Up @@ -45,7 +45,7 @@ private static void resetAll() {

@EventTarget
public void onPushOut(PushOutEvent event) {
if (ProtocolFixes.newerThanOrEqualsTo1_13() && (shouldAnimation() || mc.thePlayer.isSneaking()))
if (ProtocolFixer.newerThanOrEqualsTo1_13() && (shouldAnimation() || mc.thePlayer.isSneaking()))
event.cancelEvent();
}

Expand All @@ -56,7 +56,7 @@ public void onWorld(WorldEvent event) {

@EventTarget
public void onMotion(MotionEvent event) {
if (ProtocolFixes.newerThanOrEqualsTo1_13()) {
if (ProtocolFixer.newerThanOrEqualsTo1_13()) {
float START_HEIGHT = 1.62f;
float END_HEIGHT;

Expand All @@ -80,7 +80,7 @@ public void onMotion(MotionEvent event) {

@EventTarget
public void onUpdate(UpdateEvent event) {
if (ProtocolFixes.newerThanOrEqualsTo1_13()) {
if (ProtocolFixer.newerThanOrEqualsTo1_13()) {
if (isSwimming()) {
if (mc.thePlayer.motionX < -0.4D) {
mc.thePlayer.motionX = -0.39F;
Expand Down Expand Up @@ -119,9 +119,9 @@ public void onUpdate(UpdateEvent event) {

float sneakLength;

if (ProtocolFixes.newerThanOrEqualsTo1_9() && ProtocolFixes.olderThanOrEqualsTo1_13_2())
if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2())
sneakLength = 1.65f;
else if (ProtocolFixes.newerThanOrEqualsTo1_14())
else if (ProtocolFixer.newerThanOrEqualsTo1_14())
sneakLength = 1.5f;
else sneakLength = 1.8f;

Expand All @@ -134,12 +134,12 @@ else if (ProtocolFixes.newerThanOrEqualsTo1_14())
float newHeight;
float newWidth;

if (ProtocolFixes.newerThanOrEqualsTo1_13() && isSwimmingOrCrawling && underWater() && mc.thePlayer.rotationPitch >= 0.0) {
if (ProtocolFixer.newerThanOrEqualsTo1_13() && isSwimmingOrCrawling && underWater() && mc.thePlayer.rotationPitch >= 0.0) {
newHeight = 0.6f;
newWidth = 0.6f;
isSwimmingOrCrawling = true;
mc.thePlayer.setEntityBoundingBox(setThrough);
} else if (ProtocolFixes.newerThanOrEqualsTo1_13() && (isSwimming() && underWater() || !mc.theWorld.getCollisionBoxes(crawl).isEmpty())) {
} else if (ProtocolFixer.newerThanOrEqualsTo1_13() && (isSwimming() && underWater() || !mc.theWorld.getCollisionBoxes(crawl).isEmpty())) {
newHeight = 0.6f;
newWidth = 0.6f;
isSwimmingOrCrawling = true;
Expand All @@ -156,7 +156,7 @@ else if (ProtocolFixes.newerThanOrEqualsTo1_14())
mc.thePlayer.setEntityBoundingBox(setThrough);
}

if (ProtocolFixes.newerThanOrEqualsTo1_9() && mc.thePlayer.onGround && !mc.thePlayer.isSneaking() && !underWater() && (mc.thePlayer.height == sneakLength || mc.thePlayer.height == 0.6F) && !mc.theWorld.getCollisionBoxes(sneak).isEmpty()) {
if (ProtocolFixer.newerThanOrEqualsTo1_9() && mc.thePlayer.onGround && !mc.thePlayer.isSneaking() && !underWater() && (mc.thePlayer.height == sneakLength || mc.thePlayer.height == 0.6F) && !mc.theWorld.getCollisionBoxes(sneak).isEmpty()) {
mc.gameSettings.keyBindSneak.pressed = true;
} else if (!GameSettings.isKeyDown(mc.gameSettings.keyBindSneak) && mc.theWorld.getCollisionBoxes(sneak).isEmpty()) {
mc.gameSettings.keyBindSneak.pressed = false;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/net/aspw/client/features/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import net.aspw.client.features.module.impl.other.BrandSpoofer;
import net.aspw.client.features.module.impl.visual.Animations;
import net.aspw.client.features.module.impl.visual.SilentRotations;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.utils.*;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.AnimationUtils;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.RotationUtils;
import net.aspw.client.utils.render.RenderUtils;
import net.aspw.client.utils.timer.MSTimer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C00PacketKeepAlive;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;

import java.util.Objects;

Expand Down Expand Up @@ -59,16 +59,16 @@ public void onMotion(MotionEvent event) {

lastEyeHeight = eyeHeight;

if (ProtocolFixes.newerThanOrEqualsTo1_9() && ProtocolFixes.olderThanOrEqualsTo1_13_2())
if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2())
END_HEIGHT = 1.47f;
else if (ProtocolFixes.newerThanOrEqualsTo1_14())
else if (ProtocolFixer.newerThanOrEqualsTo1_14())
END_HEIGHT = 1.32f;
else END_HEIGHT = 1.54f;

float delta;
if (ProtocolFixes.newerThanOrEqualsTo1_9() && ProtocolFixes.olderThanOrEqualsTo1_13_2())
if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2())
delta = 0.147f;
else if (ProtocolFixes.newerThanOrEqualsTo1_14())
else if (ProtocolFixer.newerThanOrEqualsTo1_14())
delta = 0.132f;
else delta = 0.154f;

Expand Down Expand Up @@ -135,7 +135,7 @@ public void onPacket(PacketEvent event) {
packetCountTimer.reset();
}

if (ProtocolFixes.newerThanOrEqualsTo1_10()) {
if (ProtocolFixer.newerThanOrEqualsTo1_10()) {
if (packet instanceof C08PacketPlayerBlockPlacement) {
((C08PacketPlayerBlockPlacement) packet).facingX = 0.5F;
((C08PacketPlayerBlockPlacement) packet).facingY = 0.5F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import net.aspw.client.features.module.impl.player.LegitScaffold
import net.aspw.client.features.module.impl.player.Scaffold
import net.aspw.client.features.module.impl.targets.AntiBots
import net.aspw.client.features.module.impl.targets.AntiTeams
import net.aspw.client.protocol.api.ProtocolFixes
import net.aspw.client.protocol.api.ProtocolFixer
import net.aspw.client.utils.*
import net.aspw.client.utils.extensions.getDistanceToEntityBox
import net.aspw.client.utils.extensions.getNearestPointBB
Expand Down Expand Up @@ -427,7 +427,7 @@ class KillAura : Module() {
if (multiCombo.get()) {
event.targetEntity ?: return
repeat(amountValue.get()) {
if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(
C02PacketUseEntity(
event.targetEntity,
Expand All @@ -437,7 +437,7 @@ class KillAura : Module() {

mc.netHandler.addToSendQueue(C0APacketAnimation())

if (!ProtocolFixes.newerThan1_8())
if (!ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(
C02PacketUseEntity(
event.targetEntity,
Expand Down Expand Up @@ -623,7 +623,7 @@ class KillAura : Module() {
}

// Attack target
if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK))

when (swingValue.get().lowercase(Locale.getDefault())) {
Expand All @@ -637,7 +637,7 @@ class KillAura : Module() {
"packet" -> mc.netHandler.addToSendQueue(C0APacketAnimation())
}

if (!ProtocolFixes.newerThan1_8())
if (!ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK))

when (particleValue.get().lowercase()) {
Expand Down Expand Up @@ -794,7 +794,7 @@ class KillAura : Module() {
}

"1.9+" -> {
if (ProtocolFixes.newerThanOrEqualsTo1_9()) {
if (ProtocolFixer.newerThanOrEqualsTo1_9()) {
val useItem =
PacketWrapper.create(29, null, Via.getManager().connectionManager.connections.iterator().next())
useItem.write(Type.VAR_INT, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import net.aspw.client.event.WorldEvent
import net.aspw.client.features.module.Module
import net.aspw.client.features.module.ModuleCategory
import net.aspw.client.features.module.ModuleInfo
import net.aspw.client.protocol.api.ProtocolFixes
import net.aspw.client.protocol.api.ProtocolFixer
import net.aspw.client.utils.EntityUtils
import net.aspw.client.utils.PacketUtils
import net.aspw.client.utils.RotationUtils
Expand Down Expand Up @@ -133,15 +133,15 @@ class TPAura : Module() {

lastTarget = it

if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(C02PacketUseEntity(it, C02PacketUseEntity.Action.ATTACK))

when (swingValue.get().lowercase(Locale.getDefault())) {
"normal" -> mc.thePlayer.swingItem()
"packet" -> mc.netHandler.addToSendQueue(C0APacketAnimation())
}

if (!ProtocolFixes.newerThan1_8())
if (!ProtocolFixer.newerThan1_8())
mc.netHandler.addToSendQueue(C02PacketUseEntity(it, C02PacketUseEntity.Action.ATTACK))

path.reverse()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.aspw.client.injection.forge.mixins.block;

import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.minecraft.block.BlockLadder;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
Expand All @@ -14,7 +14,7 @@ public abstract class MixinBlockLadder extends MixinBlock {

@ModifyConstant(method = "setBlockBoundsBasedOnState", constant = @Constant(floatValue = 0.125F))
private float ViaVersion_LadderBB(float constant) {
if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
return 0.1875F;
return 0.125F;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.aspw.client.injection.forge.mixins.block;

import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockLilyPad;
import net.minecraft.block.state.IBlockState;
Expand All @@ -22,7 +22,7 @@ public abstract class MixinBlockLilyPad extends BlockBush {
*/
@Overwrite
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) {
if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
return new AxisAlignedBB((double) pos.getX() + 0.0625D, (double) pos.getY() + 0.0D, (double) pos.getZ() + 0.0625D, (double) pos.getX() + 0.9375D, (double) pos.getY() + 0.09375D, (double) pos.getZ() + 0.9375D);
return new AxisAlignedBB((double) pos.getX() + 0.0D, (double) pos.getY() + 0.0D, (double) pos.getZ() + 0.0D, (double) pos.getX() + 1.0D, (double) pos.getY() + 0.015625D, (double) pos.getZ() + 1.0D);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import net.aspw.client.event.*;
import net.aspw.client.features.module.impl.other.FastPlace;
import net.aspw.client.injection.forge.mixins.accessors.MinecraftForgeClientAccessor;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.CPSCounter;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.render.RenderUtils;
Expand Down Expand Up @@ -193,7 +193,7 @@ public void clickMouse() {
if (this.objectMouseOver != null) {
switch (this.objectMouseOver.typeOfHit) {
case ENTITY:
ProtocolFixes.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit);
ProtocolFixer.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit);
break;

case BLOCK:
Expand All @@ -219,7 +219,7 @@ public void clickMouse() {
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;swingItem()V")
)
private void fixAttackOrder_VanillaSwing() {
ProtocolFixes.sendConditionalSwing(this.objectMouseOver);
ProtocolFixer.sendConditionalSwing(this.objectMouseOver);
}

@Inject(method = "middleClickMouse", at = @At("HEAD"))
Expand Down Expand Up @@ -268,7 +268,7 @@ private void sendClickBlockToController(boolean leftClick) {
if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos blockPos = this.objectMouseOver.getBlockPos();

if (this.thePlayer.isUsingItem() && ProtocolFixes.newerThanOrEqualsTo1_8(false))
if (this.thePlayer.isUsingItem() && ProtocolFixer.newerThanOrEqualsTo1_8())
return;

if (this.leftClickCounter == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import net.aspw.client.event.StrafeEvent;
import net.aspw.client.features.module.impl.combat.HitBox;
import net.aspw.client.features.module.impl.movement.Flight;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.EntityUtils;
import net.aspw.client.utils.MinecraftInstance;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -354,12 +354,12 @@ private void getCollisionBorderSize(final CallbackInfoReturnable<Float> callback
final HitBox hitBoxes = Objects.requireNonNull(Launch.moduleManager.getModule(HitBox.class));

if (hitBoxes.getState() && EntityUtils.isSelected(((Entity) ((Object) this)), true)) {
if (ProtocolFixes.newerThan1_8()) {
if (ProtocolFixer.newerThan1_8()) {
callbackInfoReturnable.setReturnValue(hitBoxes.getSizeValue().get());
} else {
callbackInfoReturnable.setReturnValue(0.1F + hitBoxes.getSizeValue().get());
}
} else if (ProtocolFixes.newerThan1_8()) {
} else if (ProtocolFixer.newerThan1_8()) {
callbackInfoReturnable.setReturnValue(0.0F);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.aspw.client.features.module.impl.movement.NoJumpDelay;
import net.aspw.client.features.module.impl.visual.Animations;
import net.aspw.client.features.module.impl.visual.VisualAbilities;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.minecraft.block.Block;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.EntityLivingBase;
Expand Down Expand Up @@ -174,7 +174,7 @@ private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturn

@ModifyConstant(method = "onLivingUpdate", constant = @Constant(doubleValue = 0.005D))
private double ViaVersion_MovementThreshold(double constant) {
if (ProtocolFixes.newerThan1_8())
if (ProtocolFixer.newerThan1_8())
return 0.003D;
return 0.005D;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.aspw.client.features.module.impl.movement.LongJump;
import net.aspw.client.features.module.impl.movement.Speed;
import net.aspw.client.features.module.impl.player.BowJump;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.CooldownHelper;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.PacketUtils;
Expand Down Expand Up @@ -144,7 +144,7 @@ public float getEyeHeight() {
final Flight flight = Objects.requireNonNull(Launch.moduleManager.getModule(Flight.class));
final Speed speed = Objects.requireNonNull(Launch.moduleManager.getModule(Speed.class));
final BowJump bowJump = Objects.requireNonNull(Launch.moduleManager.getModule(BowJump.class));
if (ProtocolFixes.newerThanOrEqualsTo1_13() && McUpdatesHandler.doingEyeRot)
if (ProtocolFixer.newerThanOrEqualsTo1_13() && McUpdatesHandler.doingEyeRot)
return McUpdatesHandler.lastEyeHeight + (McUpdatesHandler.eyeHeight - McUpdatesHandler.lastEyeHeight) * mc.timer.renderPartialTicks;
if (this.isPlayerSleeping())
return 0.2F;
Expand Down Expand Up @@ -180,15 +180,15 @@ private void injectCooldown(final CallbackInfo callbackInfo) {
@Inject(method = "dropItem", at = @At("HEAD"))
private void dropItem(ItemStack p_dropItem_1_, boolean p_dropItem_2_, boolean p_dropItem_3_, CallbackInfoReturnable<EntityItem> cir) {
for (int i = 0; i < this.mainInventory.length; ++i) {
if (ProtocolFixes.newerThanOrEqualsTo1_16())
if (ProtocolFixer.newerThanOrEqualsTo1_16())
PacketUtils.sendPacketNoEvent(new C0APacketAnimation());
if (this.mainInventory[i] != null) {
this.mainInventory[i] = null;
}
}

for (int j = 0; j < this.armorInventory.length; ++j) {
if (ProtocolFixes.newerThanOrEqualsTo1_16())
if (ProtocolFixer.newerThanOrEqualsTo1_16())
PacketUtils.sendPacketNoEvent(new C0APacketAnimation());
if (this.armorInventory[j] != null) {
this.armorInventory[j] = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.aspw.client.features.module.impl.movement.SilentSneak;
import net.aspw.client.features.module.impl.player.Scaffold;
import net.aspw.client.features.module.impl.visual.Interface;
import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.CooldownHelper;
import net.aspw.client.utils.MovementUtils;
import net.aspw.client.utils.Rotation;
Expand Down Expand Up @@ -216,7 +216,7 @@ public void updateEntityActionState() {

@Redirect(method = "onUpdateWalkingPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/NetHandlerPlayClient;addToSendQueue(Lnet/minecraft/network/Packet;)V", ordinal = 7))
public void emulateIdlePacket(final NetHandlerPlayClient instance, final Packet<?> p_addToSendQueue_1_) {
if (ProtocolFixes.newerThan1_8()) {
if (ProtocolFixer.newerThan1_8()) {
if (this.viaForge$prevOnGround == this.onGround) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.aspw.client.injection.forge.mixins.item;

import net.aspw.client.protocol.api.ProtocolFixes;
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.MinecraftInstance;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
Expand Down Expand Up @@ -52,7 +52,7 @@ public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn,
this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack);
}

if (ProtocolFixes.newerThan1_8()) {
if (ProtocolFixer.newerThan1_8()) {
MinecraftInstance.mc.theWorld.playSoundAtPos(pos.add(0.5, 0.5, 0.5), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F, false);
} else {
worldIn.playSoundEffect((float) pos.getX() + 0.5F, (float) pos.getY() + 0.5F, (float) pos.getZ() + 0.5F, this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F);
Expand Down
Loading

0 comments on commit 5457ec7

Please sign in to comment.