Skip to content

Commit

Permalink
Merge pull request #49 from Xatsec/master
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonk9043 committed Jun 25, 2024
2 parents fc80ede + f52cf18 commit 31b9502
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/aoba/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class ModuleManager implements KeyDownListener {
public Module anticactus = new AntiCactus();
public Module antiinvis = new AntiInvis();
public Module antiknockback = new AntiKnockback();
public Module antikick = new AntiKick();
public Module autoeat = new AutoEat();
public Module autofarm = new AutoFarm();
public Module autofish = new AutoFish();
Expand All @@ -63,6 +64,7 @@ public class ModuleManager implements KeyDownListener {
public Module crystalaura = new CrystalAura();
public Module clickTP = new ClickTP();
public Module entityesp = new EntityESP();
public Module fastladder = new FastLadder();
public Module fastplace = new FastPlace();
public Module fastbreak = new FastBreak();
public Module fly = new Fly();
Expand All @@ -88,6 +90,7 @@ public class ModuleManager implements KeyDownListener {
public Module safewalk = new Safewalk();
public Module sneak = new Sneak();
public Module spawneresp = new SpawnerESP();
public Module speed = new Speed();
public Module spider = new Spider();
public Module sprint = new Sprint();
public Module step = new Step();
Expand All @@ -106,6 +109,7 @@ public ModuleManager() {
addModule(anticactus);
addModule(antiinvis);
addModule(antiknockback);
addModule(antikick);
addModule(autoeat);
addModule(autofarm);
addModule(autofish);
Expand All @@ -120,6 +124,7 @@ public ModuleManager() {
addModule(crystalaura);
addModule(clickTP);
addModule(entityesp);
addModule(fastladder);
addModule(fastplace);
addModule(fastbreak);
addModule(fly);
Expand All @@ -145,6 +150,7 @@ public ModuleManager() {
addModule(safewalk);
addModule(sneak);
addModule(spawneresp);
addModule(speed);
addModule(spider);
addModule(sprint);
addModule(step);
Expand Down
64 changes: 64 additions & 0 deletions src/main/java/net/aoba/module/modules/misc/AntiKick.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package net.aoba.module.modules.misc;

import net.aoba.Aoba;
import net.aoba.event.events.TickEvent;
import net.aoba.event.listeners.TickListener;
import net.aoba.module.Module;
import net.aoba.settings.types.FloatSetting;
import net.aoba.settings.types.KeybindSetting;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class AntiKick extends Module implements TickListener {

//Experimental

private FloatSetting ticks;
private FloatSetting duration;

public int i = 0;

public AntiKick() {
super(new KeybindSetting("key.antikick", "AntiKick Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0)));

this.setName("AntiKick");
this.setCategory(Category.Misc);
this.setDescription("Avoids being kicked for 'Flying is not enabled on this Server'");

ticks = new FloatSetting("ticks", "Ticks", "Amount of Ticks between Execution", 40f, 10f, 50f, 10f);
duration = new FloatSetting("duration", "Duration", "Duration in Ticks", 1f, 1f, 5f, 1f);

this.addSetting(ticks);
this.addSetting(duration);
}

@Override
public void onDisable() {
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this);
}

@Override
public void onEnable() {
Aoba.getInstance().eventManager.AddListener(TickListener.class, this);
}

@Override
public void onToggle() {

}

@Override
public void OnUpdate(TickEvent event) {
//Basically deactivates and reactivates the Flymodule in the set Period of ticks to avoid being Kicked for "Flying is not enabled on this Server"
//For now, vertical Movement still can get you kicked if you are not carefull
if(i == ticks.getValue() && Aoba.getInstance().moduleManager.fly.getState()) {
Aoba.getInstance().moduleManager.fly.toggle();
}
if(i == ticks.getValue() + duration.getValue() && !Aoba.getInstance().moduleManager.fly.getState()) {
Aoba.getInstance().moduleManager.fly.toggle();
i = 0;
}
i ++;

}
}
58 changes: 58 additions & 0 deletions src/main/java/net/aoba/module/modules/movement/FastLadder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package net.aoba.module.modules.movement;

import net.aoba.Aoba;
import net.aoba.event.events.TickEvent;
import net.aoba.event.listeners.TickListener;
import net.aoba.module.Module;
import net.aoba.settings.types.FloatSetting;
import net.aoba.settings.types.KeybindSetting;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.glfw.GLFW;

public class FastLadder extends Module implements TickListener {

private FloatSetting ladderSpeed;

public FastLadder() {
super(new KeybindSetting("key.fastladder", "FastLadder Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0)));

this.setName("FastLadder");
this.setCategory(Category.Movement);
this.setDescription("Allows players to climb up Ladders faster");

ladderSpeed = new FloatSetting("fastladder_speed", "Speed", "Speed for FastLadder Module", 0.2f, 0.1f, 0.5f, 0.1f);
this.addSetting(ladderSpeed);
}

@Override
public void onDisable() {
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this);
}

@Override
public void onEnable() {
Aoba.getInstance().eventManager.AddListener(TickListener.class, this);
}

@Override
public void onToggle() {

}

@Override
public void OnUpdate(TickEvent event) {
ClientPlayerEntity player = MC.player;

if(!player.isClimbing() || !player.horizontalCollision)
return;

if(player.input.movementForward == 0
&& player.input.movementSideways == 0)
return;

Vec3d velocity = player.getVelocity();
player.setVelocity(velocity.x, ladderSpeed.getValue() + 0.08, velocity.z);
}
}
65 changes: 65 additions & 0 deletions src/main/java/net/aoba/module/modules/movement/Speed.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package net.aoba.module.modules.movement;

import net.aoba.Aoba;
import net.aoba.event.events.TickEvent;
import net.aoba.event.listeners.TickListener;
import net.aoba.module.Module;
import net.aoba.settings.types.FloatSetting;
import net.aoba.settings.types.KeybindSetting;
import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.attribute.EntityAttributeInstance;
import net.minecraft.entity.attribute.EntityAttributes;
import org.lwjgl.glfw.GLFW;

public class Speed extends Module implements TickListener {

private FloatSetting speedSetting;

public Speed() {
super(new KeybindSetting("key.speed", "Speed Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0)));

this.setName("Speed");
this.setCategory(Category.Movement);
this.setDescription("Modifies the Movement-Speed of the Player");

speedSetting = new FloatSetting("speed_setting", "Speed", "Speed", 0.2f, 0.1f, 6f, 0.1f);

speedSetting.setOnUpdate((i) -> {
if(this.getState()) {
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
attribute.setBaseValue(speedSetting.getValue());
}
});

this.addSetting(speedSetting);
}

@Override
public void onDisable() {
MC.options.getFovEffectScale().setValue(100.0);
if(MC.player != null) {
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
attribute.setBaseValue(0.1);
}
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this);
}

@Override
public void onEnable() {
MC.options.getFovEffectScale().setValue(0.0);
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
attribute.setBaseValue(speedSetting.getValue());
Aoba.getInstance().eventManager.AddListener(TickListener.class, this);
}

@Override
public void onToggle() {

}

@Override
public void OnUpdate(TickEvent event) {
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
attribute.setBaseValue(speedSetting.getValue());
}
}

0 comments on commit 31b9502

Please sign in to comment.