diff --git a/src/main/java/net/aspw/client/features/api/PacketManager.java b/src/main/java/net/aspw/client/features/api/PacketManager.java index 17cc9ac3..8acf585f 100644 --- a/src/main/java/net/aspw/client/features/api/PacketManager.java +++ b/src/main/java/net/aspw/client/features/api/PacketManager.java @@ -40,11 +40,18 @@ public void onRender3D(Render3DEvent event) { if (mc.gameSettings.keyBindAttack.isKeyDown() && mc.leftClickCounter == 0 && mc.theWorld.getBlockState(mc.objectMouseOver.getBlockPos()).getBlock().getMaterial() != Material.air) Launch.eventManager.callEvent(new ClickBlockEvent(mc.objectMouseOver.getBlockPos(), mc.objectMouseOver.sideHit)); - if (RotationUtils.targetRotation != null && Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getState()) { - mc.thePlayer.prevRenderArmYaw = RotationUtils.targetRotation.getYaw(); - mc.thePlayer.prevRenderArmPitch = RotationUtils.targetRotation.getPitch(); - mc.thePlayer.renderArmYaw = RotationUtils.targetRotation.getYaw(); - mc.thePlayer.renderArmPitch = RotationUtils.targetRotation.getPitch(); + if (Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getState()) { + if (RotationUtils.targetRotation != null) { + mc.thePlayer.prevRenderArmYaw = RotationUtils.targetRotation.getYaw(); + mc.thePlayer.prevRenderArmPitch = RotationUtils.targetRotation.getPitch(); + mc.thePlayer.renderArmYaw = RotationUtils.targetRotation.getYaw(); + mc.thePlayer.renderArmPitch = RotationUtils.targetRotation.getPitch(); + } else { + mc.thePlayer.prevRenderArmYaw = RotationUtils.prevCameraArmYaw; + mc.thePlayer.prevRenderArmPitch = RotationUtils.prevCameraArmPitch; + mc.thePlayer.renderArmYaw = RotationUtils.cameraArmYaw; + mc.thePlayer.renderArmPitch = RotationUtils.cameraArmPitch; + } } } diff --git a/src/main/java/net/aspw/client/features/module/impl/player/LegitScaffold.kt b/src/main/java/net/aspw/client/features/module/impl/player/LegitScaffold.kt index 91e1f134..289768cb 100644 --- a/src/main/java/net/aspw/client/features/module/impl/player/LegitScaffold.kt +++ b/src/main/java/net/aspw/client/features/module/impl/player/LegitScaffold.kt @@ -44,7 +44,7 @@ class LegitScaffold : Module() { } private val tickTimer = TickTimer() - private var lastSlot = 0 + var lastSlot = 0 override fun onEnable() { lastSlot = mc.thePlayer.inventory.currentItem diff --git a/src/main/java/net/aspw/client/features/module/impl/player/Scaffold.kt b/src/main/java/net/aspw/client/features/module/impl/player/Scaffold.kt index c672a915..a1c0e338 100644 --- a/src/main/java/net/aspw/client/features/module/impl/player/Scaffold.kt +++ b/src/main/java/net/aspw/client/features/module/impl/player/Scaffold.kt @@ -213,7 +213,7 @@ class Scaffold : Module() { // Auto block slot private var slot = 0 - private var lastSlot = 0 + var lastSlot = 0 private var delay: Long = 0 diff --git a/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt b/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt index 755686f0..c0cc7007 100644 --- a/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt +++ b/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt @@ -73,6 +73,7 @@ class SilentRotations : Module() { if (mc.thePlayer == null || RotationUtils.targetRotation == null) { if (rotating) rotating = false + mc.thePlayer.prevRotationYaw = RotationUtils.prevCameraYaw mc.thePlayer.prevRotationPitch = RotationUtils.prevCameraPitch mc.thePlayer.rotationYaw = RotationUtils.cameraYaw diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java index 6db1a284..748ab7f4 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java @@ -139,6 +139,11 @@ public void updateEntityActionState() { this.prevRenderArmPitch = this.renderArmPitch; this.renderArmPitch = (float) ((double) this.renderArmPitch + (double) (this.rotationPitch - this.renderArmPitch) * 0.5D); this.renderArmYaw = (float) ((double) this.renderArmYaw + (double) (this.rotationYaw - this.renderArmYaw) * 0.5D); + + RotationUtils.prevCameraArmYaw = RotationUtils.cameraArmYaw; + RotationUtils.prevCameraArmPitch = RotationUtils.cameraArmPitch; + RotationUtils.cameraArmPitch = (float) ((double) RotationUtils.cameraArmPitch + (double) (RotationUtils.cameraPitch - RotationUtils.cameraArmPitch) * 0.5D); + RotationUtils.cameraArmYaw = (float) ((double) RotationUtils.cameraArmYaw + (double) (RotationUtils.cameraYaw - RotationUtils.cameraArmYaw) * 0.5D); } } diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java index 577af5bd..1d348085 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java @@ -4,6 +4,8 @@ import net.aspw.client.features.module.impl.combat.KillAura; import net.aspw.client.features.module.impl.combat.KillAuraRecode; import net.aspw.client.features.module.impl.combat.TPAura; +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.visual.Animations; import net.aspw.client.features.module.impl.visual.VisualAbilities; import net.aspw.client.utils.TimerUtils; @@ -737,6 +739,20 @@ public void renderItemInFirstPerson(final float partialTicks) { GlStateManager.scale(Animations.scale.get() + 1, Animations.scale.get() + 1, Animations.scale.get() + 1); } } else { + if (Objects.requireNonNull(Launch.moduleManager.getModule(Scaffold.class)).getState()) { + if (this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(Scaffold.class)).getLastSlot()) == null && !abstractclientplayer.isInvisible()) { + if (Animations.cancelEquip.get() && !Animations.blockingOnly.get()) + this.renderPlayerArm(abstractclientplayer, 0.0F, f1); + else this.renderPlayerArm(abstractclientplayer, f, f1); + } + } else if (Objects.requireNonNull(Launch.moduleManager.getModule(LegitScaffold.class)).getState()) { + if (this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(LegitScaffold.class)).getLastSlot()) == null && !abstractclientplayer.isInvisible()) { + if (Animations.cancelEquip.get() && !Animations.blockingOnly.get()) + this.renderPlayerArm(abstractclientplayer, 0.0F, f1); + else this.renderPlayerArm(abstractclientplayer, f, f1); + } + } + if (Animations.swingAnimValue.get().equals("1.7")) { if (f1 != 0.0F) { GlStateManager.scale(0.85F, 0.85F, 0.85F); @@ -774,9 +790,14 @@ public void renderItemInFirstPerson(final float partialTicks) { GlStateManager.scale(Animations.scale.get() + 1, Animations.scale.get() + 1, Animations.scale.get() + 1); } - this.renderItem(abstractclientplayer, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON); + if (Objects.requireNonNull(Launch.moduleManager.getModule(Scaffold.class)).getState() && this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(Scaffold.class)).getLastSlot()) != null) + this.renderItem(abstractclientplayer, this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(Scaffold.class)).getLastSlot()), ItemCameraTransforms.TransformType.FIRST_PERSON); + else if (Objects.requireNonNull(Launch.moduleManager.getModule(LegitScaffold.class)).getState() && this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(LegitScaffold.class)).getLastSlot()) != null) + this.renderItem(abstractclientplayer, this.mc.thePlayer.inventory.getStackInSlot(Objects.requireNonNull(Launch.moduleManager.getModule(LegitScaffold.class)).getLastSlot()), ItemCameraTransforms.TransformType.FIRST_PERSON); + else + this.renderItem(abstractclientplayer, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON); } else if (!abstractclientplayer.isInvisible()) { - if (Animations.cancelEquip.get()) + if (Animations.cancelEquip.get() && !Animations.blockingOnly.get()) this.renderPlayerArm(abstractclientplayer, 0.0F, f1); else this.renderPlayerArm(abstractclientplayer, f, f1); } diff --git a/src/main/java/net/aspw/client/utils/RotationUtils.kt b/src/main/java/net/aspw/client/utils/RotationUtils.kt index 37be0245..e60b4f2e 100644 --- a/src/main/java/net/aspw/client/utils/RotationUtils.kt +++ b/src/main/java/net/aspw/client/utils/RotationUtils.kt @@ -113,6 +113,18 @@ class RotationUtils : MinecraftInstance(), Listenable { @JvmField var prevCameraPitch = 0f + @JvmField + var cameraArmYaw = 0f + + @JvmField + var cameraArmPitch = 0f + + @JvmField + var prevCameraArmYaw = 0f + + @JvmField + var prevCameraArmPitch = 0f + @JvmStatic fun overrideMouse(): Boolean { if (mc.inGameHasFocus && Display.isActive()) {