Skip to content

Commit

Permalink
Release 1.8.0
Browse files Browse the repository at this point in the history
- [+] **Add** Animations.
    - Allow you change swing/block animation and speed.
    - Override LabyMod 'block/swing' option.
- [+] **Add** FreeLook.
- [+] **Add** Step.
    - Made for Hypixel.
- [※] **Improve** Backtrack.
- [+] **Add** 'LegitInv' mode to InvMove.
- [※] **Fix** 'Sort mode' of KillAura doesn't work.
- [+] **Add** 'WaitBreakBlock' to Phase.
- [※] **Improve** JumpReset.
- [※] **Fix** AntiVoid sometimes do useless blink.
- [※] **Fix** 'Hit through block' of Reach sometimes crash with FastMine.
- [※] **Fix** sometimes crash on starting client.
- [+] **Add** 'LowHopTest', 'Strafe B' mode to Speed.
    - Thanks to @dragon.
- [+] **Add** 'Hypixel' mode to Timer.
    - Thanks to @dragon.
- [※] **Fix** Slider sometimes draws wrong.
- [+] **Add** 'Hypixel' mode to Sprint.
    - Old Sprint now is called 'Legit' mode.
- [+] **Add** 'Cancel air' option to Velocity.
  • Loading branch information
xia-mc committed Jul 1, 2024
1 parent 8cae12f commit fda2f44
Show file tree
Hide file tree
Showing 38 changed files with 1,049 additions and 166 deletions.
Binary file added logo/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo/logo.psd
Binary file not shown.
8 changes: 5 additions & 3 deletions src/main/java/keystrokesmod/Raven.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ public void onTick(@NotNull ClientTickEvent e) {
module.onUpdate();
}
}
for (Profile profile : Raven.profileManager.profiles) {
if (mc.currentScreen == null) {
profile.getModule().keybind();
synchronized (Raven.profileManager.profiles) {
for (Profile profile : Raven.profileManager.profiles) {
if (mc.currentScreen == null) {
profile.getModule().keybind();
}
}
}
for (Module module : Raven.scriptManager.scripts.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void onClick(int x, int y, int b) {
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
parent.categoryComponent.render();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,32 @@ public void onDrawScreen(int x, int y) {
}

public void onClick(int x, int y, int b) {
if (isHover(x, y) && b == 0 && this.parent.po) {
if (Keyboard.isKeyDown(Raven.mc.gameSettings.keyBindSneak.getKeyCode())) {
this.ModeSetting.prevValue();
} else {
this.ModeSetting.nextValue();
}
if (isHover(x, y) && this.parent.po) {
changeValue(b, Keyboard.isKeyDown(Raven.mc.gameSettings.keyBindSneak.getKeyCode()));
parent.categoryComponent.render();
}
}

private void changeValue(int b, boolean reserve) {
boolean next;
switch (b) {
case 0:
next = true;
break;
case 1:
next = false;
break;
default:
return;
}

if (reserve)
next = !next;

if (next) {
this.ModeSetting.nextValue();
} else {
this.ModeSetting.prevValue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ public void onDrawScreen(int x, int y) {
this.w = (double) (this.parent.categoryComponent.gw() - 8) * (this.sliderSetting.getInput() - this.sliderSetting.getMin()) / (this.sliderSetting.getMax() - this.sliderSetting.getMin());
if (this.d) {
if (d == 0.0D) {
this.sliderSetting.setValue(this.sliderSetting.getMin());
if (this.sliderSetting.getInput() != this.sliderSetting.getMin() && ModuleManager.hud != null && ModuleManager.hud.isEnabled() && !ModuleManager.organizedModules.isEmpty()) {
ModuleManager.sort();
}
this.sliderSetting.setValue(this.sliderSetting.getMin());
parent.categoryComponent.render();
} else {
double n = roundToInterval(d / (double) (this.parent.categoryComponent.gw() - 8) * (this.sliderSetting.getMax() - this.sliderSetting.getMin()) + this.sliderSetting.getMin(), 2);
this.sliderSetting.setValue(n);
if (this.sliderSetting.getInput() != n && ModuleManager.hud != null && ModuleManager.hud.isEnabled() && !ModuleManager.organizedModules.isEmpty()) {
ModuleManager.sort();
}
this.sliderSetting.setValue(n);
parent.categoryComponent.render();
}
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/keystrokesmod/event/PostVelocityEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package keystrokesmod.event;

import net.minecraftforge.fml.common.eventhandler.Event;

public class PostVelocityEvent extends Event {
}
71 changes: 71 additions & 0 deletions src/main/java/keystrokesmod/event/RenderItemEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package keystrokesmod.event;

import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

@Cancelable
public final class RenderItemEvent extends Event {
private EnumAction enumAction;
private boolean useItem;
private float animationProgression, partialTicks, swingProgress;
private ItemStack itemToRender;

public RenderItemEvent(EnumAction enumAction, boolean useItem, float animationProgression, float partialTicks, float swingProgress, ItemStack itemToRender) {
this.enumAction = enumAction;
this.useItem = useItem;
this.animationProgression = animationProgression;
this.partialTicks = partialTicks;
this.swingProgress = swingProgress;
this.itemToRender = itemToRender;
}

public EnumAction getEnumAction() {
return enumAction;
}

public void setEnumAction(EnumAction enumAction) {
this.enumAction = enumAction;
}

public boolean isUseItem() {
return useItem;
}

public void setUseItem(boolean useItem) {
this.useItem = useItem;
}

public float getAnimationProgression() {
return animationProgression;
}

public void setAnimationProgression(float animationProgression) {
this.animationProgression = animationProgression;
}

public float getPartialTicks() {
return partialTicks;
}

public void setPartialTicks(float partialTicks) {
this.partialTicks = partialTicks;
}

public float getSwingProgress() {
return swingProgress;
}

public void setSwingProgress(float swingProgress) {
this.swingProgress = swingProgress;
}

public ItemStack getItemToRender() {
return itemToRender;
}

public void setItemToRender(ItemStack itemToRender) {
this.itemToRender = itemToRender;
}
}
15 changes: 15 additions & 0 deletions src/main/java/keystrokesmod/event/StepEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package keystrokesmod.event;

import net.minecraftforge.fml.common.eventhandler.Event;

public class StepEvent extends Event {
private final double height;

public StepEvent(double height) {
this.height = height;
}

public double getHeight() {
return height;
}
}
19 changes: 19 additions & 0 deletions src/main/java/keystrokesmod/event/SwingAnimationEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package keystrokesmod.event;

import net.minecraftforge.fml.common.eventhandler.Event;

public final class SwingAnimationEvent extends Event {
private int animationEnd;

public SwingAnimationEvent(int animationEnd) {
this.animationEnd = animationEnd;
}

public int getAnimationEnd() {
return animationEnd;
}

public void setAnimationEnd(int animationEnd) {
this.animationEnd = animationEnd;
}
}
10 changes: 9 additions & 1 deletion src/main/java/keystrokesmod/mixins/impl/entity/MixinEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import keystrokesmod.event.PostInputEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.PrePlayerInput;
import keystrokesmod.event.StepEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.module.impl.world.SafeWalk;
Expand All @@ -14,13 +15,15 @@
import net.minecraft.block.BlockWall;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -235,13 +238,18 @@ public void moveEntity(double x, double y, double z) {

this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, 0.0D, z));

if ((Entity)(Object) this instanceof EntityPlayerSP) {
StepEvent event = new StepEvent(this.getEntityBoundingBox().minY - this.posY);
MinecraftForge.EVENT_BUS.post(event);
}

if (this.stepHeight > 0.0F && flag1 && (d3 != x || d5 != z)) {
double d11 = x;
double d7 = y;
double d8 = z;
AxisAlignedBB axisalignedbb3 = this.getEntityBoundingBox();
this.setEntityBoundingBox(axisalignedbb);
y = (double) this.stepHeight;
y = this.stepHeight;
List<AxisAlignedBB> list = this.worldObj.getCollidingBoundingBoxes((Entity) ((Object) this), this.getEntityBoundingBox().addCoord(d3, y, d5));
AxisAlignedBB axisalignedbb4 = this.getEntityBoundingBox();
AxisAlignedBB axisalignedbb5 = axisalignedbb4.addCoord(d3, 0.0D, d5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import com.google.common.collect.Maps;
import keystrokesmod.event.JumpEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.SwingAnimationEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
Expand All @@ -15,6 +18,7 @@
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -117,13 +121,13 @@ protected void jump() {
this.motionY = jumpEvent.getMotionY();

if (this.isPotionActive(Potion.jump)) {
this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
this.motionY += (float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}

if (this.isSprinting()) {
float f = jumpEvent.getYaw() * 0.017453292F;
this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}

this.isAirBorne = true;
Expand All @@ -136,4 +140,22 @@ private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturn
callbackInfoReturnable.setReturnValue(false);
}
}
}

/**
* @author xia__mc
* @reason for Animations module
*/
@Overwrite
private int getArmSwingAnimationEnd() {
int swingAnimationEnd = this.isPotionActive(Potion.digSpeed) ? 6 -
(1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) :
(this.isPotionActive(Potion.digSlowdown) ? 6 +
(1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6);

SwingAnimationEvent swingAnimationEvent = new SwingAnimationEvent(swingAnimationEnd);
MinecraftForge.EVENT_BUS.post(swingAnimationEvent);
swingAnimationEnd = swingAnimationEvent.getAnimationEnd();

return (int) (swingAnimationEnd * Utils.getTimer().timerSpeed);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package keystrokesmod.mixins.impl.network;


import keystrokesmod.Raven;
import keystrokesmod.event.PostVelocityEvent;
import keystrokesmod.utility.Utils;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(NetHandlerPlayClient.class)
public abstract class MixinNetHandlerPlayClient {

@Inject(method = "handleEntityVelocity", at = @At("RETURN"))
public void onHandleEntityVelocity(S12PacketEntityVelocity packet, CallbackInfo ci) {
if (!Utils.nullCheck()) return;

if (packet.getEntityID() == Raven.mc.thePlayer.getEntityId()) {
MinecraftForge.EVENT_BUS.post(new PostVelocityEvent());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package keystrokesmod.mixins.impl.render;

import net.minecraft.client.renderer.ItemRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(ItemRenderer.class)
public interface ItemRendererAccessor {

@Invoker("transformFirstPersonItem")
void transformFirstPersonItem(float animationProgression, float swingProgress);

@Invoker("func_178103_d")
void blockTransformation();
}
Loading

0 comments on commit fda2f44

Please sign in to comment.