Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Aug 28, 2023
1 parent 2813441 commit 2969910
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 49 deletions.
37 changes: 19 additions & 18 deletions NightX.iws
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<component name="ChangeListManager">
<list default="true" id="af093b99-5942-419c-869b-8b2d7cb4dd2a" name="変更" comment="">
<change beforePath="$PROJECT_DIR$/NightX.iws" beforeDir="false" afterPath="$PROJECT_DIR$/NightX.iws" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/AutoHeal.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/AutoHeal.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/visual/Hud.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/visual/Hud.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
Expand Down Expand Up @@ -61,7 +62,7 @@
<option name="stateVersion" value="1" />
</component>
<component name="ProblemsViewState">
<option name="selectedTabId" value="ProjectErrors" />
<option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="2" />
Expand Down Expand Up @@ -139,7 +140,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -154,7 +155,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -199,7 +200,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -214,7 +215,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -229,7 +230,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -244,7 +245,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -259,7 +260,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -274,7 +275,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -301,7 +302,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -316,7 +317,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -361,7 +362,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -376,7 +377,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -391,7 +392,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -406,7 +407,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -421,7 +422,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -436,7 +437,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AutoHeal : Module() {
}

override fun onDisable() {
isRotating = false
resetAll()
}

override fun onEnable() {
Expand All @@ -108,9 +108,21 @@ class AutoHeal : Module() {
@EventTarget(priority = 2)
fun onMotion(event: MotionEvent) {
if (autoPotValue.get()) {
if (mc.thePlayer.fallDistance < 0.8) return
if (event.eventState == EventState.PRE) {
if (smartValue.get() && !throwQueue.isEmpty()) {
if (throwing && mc.currentScreen !is GuiContainer && (!killAura?.state!! || killAura.target == null) && !scaffold?.state!!) {
if (mc.thePlayer.onGround) {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
mc.thePlayer.jump()
debug("jumped")
}
RotationUtils.reset() // reset all rotations
event.pitch = if (customPitchValue.get()) customPitchAngle.get() else 90F
debug("silent rotation")
isRotating = true
}

if (smartValue.get() && throwQueue.isNotEmpty()) {
var foundPot = false
for (k in throwQueue.indices.reversed()) {
if (mc.thePlayer.isPotionActive(throwQueue[k])) {
Expand Down Expand Up @@ -167,21 +179,6 @@ class AutoHeal : Module() {
debug("found pot, queueing")
}
}

if (throwing && mc.currentScreen !is GuiContainer && (!killAura?.state!! || killAura.target == null) && !scaffold?.state!!) {
if (mc.thePlayer.onGround) {
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionZ = 0.0
mc.thePlayer.jump()
debug("jumped")
}
RotationUtils.reset() // reset all rotations
event.pitch = if (customPitchValue.get()) customPitchAngle.get() else 90F
debug("silent rotation")
isRotating = true
} else {
isRotating = false
}
}
}
}
Expand Down Expand Up @@ -281,7 +278,6 @@ class AutoHeal : Module() {
@EventTarget(priority = -1)
fun onMotionPost(event: MotionEvent) {
if (autoPotValue.get()) {
if (mc.thePlayer.fallDistance < 0.8) return
if (event.eventState == EventState.POST) {
if (throwing && mc.currentScreen !is GuiContainer
&& !mc.thePlayer.onGround
Expand All @@ -306,9 +302,9 @@ class AutoHeal : Module() {
isRotating = false
debug("thrown")
} else {
// refind
potIndex = -1
throwing = false
isRotating = false
debug("failed to retrieve potion info, retrying...")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import net.aspw.client.features.module.ModuleInfo
import net.aspw.client.util.AnimationUtils
import net.aspw.client.util.render.RenderUtils
import net.aspw.client.value.*
import net.aspw.client.visual.client.GuiTeleportation
import net.aspw.client.visual.client.clickgui.dropdown.ClickGui
import net.aspw.client.visual.client.clickgui.tab.NewUi
import net.aspw.client.visual.font.Fonts
Expand Down Expand Up @@ -73,7 +74,7 @@ class Hud : Module() {
}

if (mc.theWorld == null || mc.thePlayer == null) return
if (noInvClose.get() && event.packet is S2EPacketCloseWindow && (mc.currentScreen is GuiInventory || mc.currentScreen is NewUi || mc.currentScreen is ClickGui || mc.currentScreen is GuiChat)) {
if (noInvClose.get() && event.packet is S2EPacketCloseWindow && (mc.currentScreen is GuiInventory || mc.currentScreen is NewUi || mc.currentScreen is ClickGui || mc.currentScreen is GuiChat || mc.currentScreen is GuiTeleportation)) {
event.cancelEvent()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ public void onUpdateWalkingPlayer() {
final KillAura killAura = Objects.requireNonNull(Client.moduleManager.getModule(KillAura.class));
final TPAura tpAura = Objects.requireNonNull(Client.moduleManager.getModule(TPAura.class));

float yaw = event.getYaw();
float pitch = event.getPitch();
float lastReportedYaw = RotationUtils.serverRotation.getYaw();
float lastReportedPitch = RotationUtils.serverRotation.getPitch();

if (RotationUtils.targetRotation != null) {
yaw = RotationUtils.targetRotation.getYaw();
pitch = RotationUtils.targetRotation.getPitch();
}

if (mc.thePlayer.isSneaking() && (mc.thePlayer.isBlocking() || (killAura.getState() && killAura.getTarget() != null && !killAura.getAutoBlockModeValue().get().equals("None") || tpAura.getState() && tpAura.isBlocking())))
mc.thePlayer.renderArmYaw = mc.thePlayer.rotationYaw - 40F;

Expand Down Expand Up @@ -247,6 +237,16 @@ public void onUpdateWalkingPlayer() {
}

if (this.isCurrentViewEntity()) {
float yaw = event.getYaw();
float pitch = event.getPitch();
float lastReportedYaw = RotationUtils.serverRotation.getYaw();
float lastReportedPitch = RotationUtils.serverRotation.getPitch();

if (RotationUtils.targetRotation != null) {
yaw = RotationUtils.targetRotation.getYaw();
pitch = RotationUtils.targetRotation.getPitch();
}

final AntiDesync antiDesync = Objects.requireNonNull(Client.moduleManager.getModule(AntiDesync.class));
double xDiff = event.getX() - this.lastReportedPosX;
double yDiff = event.getY() - this.lastReportedPosY;
Expand Down

0 comments on commit 2969910

Please sign in to comment.