Skip to content

Commit

Permalink
Added new modules + module fixes.
Browse files Browse the repository at this point in the history
- Added ClickTP module based on LiveOverflow's ClickTP.
- Added right click mouse event listeners and events.
- Added HighJump
- Fixed Spider
- Fixed issue where block gui components would not render the selected block correctly.
- Fixed issue where Vignette would be applied to Aoba HUD.
- Prettied up Button component and added hover color.
- Added plenty of extra module options. (AutoRespawn, CrystalAura, KillAura, MaceAura, Glide, Spider)
  • Loading branch information
coltonk9043 committed Jun 23, 2024
1 parent fcd5968 commit 4c366e3
Show file tree
Hide file tree
Showing 21 changed files with 430 additions and 33 deletions.
59 changes: 59 additions & 0 deletions src/main/java/net/aoba/event/events/RightMouseDownEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Aoba Hacked Client
* Copyright (C) 2019-2024 coltonk9043
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package net.aoba.event.events;

import java.util.ArrayList;
import java.util.List;
import net.aoba.event.listeners.AbstractListener;
import net.aoba.event.listeners.LeftMouseDownListener;
import net.aoba.event.listeners.RightMouseDownListener;

public class RightMouseDownEvent extends AbstractEvent{

double mouseX;
double mouseY;

public RightMouseDownEvent(double mouseX2, double mouseY2) {
super();
this.mouseX = mouseX2;
this.mouseY = mouseY2;
}

public double GetMouseX() {
return mouseX;
}

public double GetMouseY() {
return mouseY;
}

@Override
public void Fire(ArrayList<? extends AbstractListener> listeners) {
for(AbstractListener listener : List.copyOf(listeners)) {
RightMouseDownListener mouseRightClickListener = (RightMouseDownListener) listener;
mouseRightClickListener.OnRightMouseDown(this);
}
}

@SuppressWarnings("unchecked")
@Override
public Class<RightMouseDownListener> GetListenerClassType() {
return RightMouseDownListener.class;
}
}
59 changes: 59 additions & 0 deletions src/main/java/net/aoba/event/events/RightMouseUpEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Aoba Hacked Client
* Copyright (C) 2019-2024 coltonk9043
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package net.aoba.event.events;

import java.util.ArrayList;
import java.util.List;
import net.aoba.event.listeners.AbstractListener;
import net.aoba.event.listeners.LeftMouseUpListener;
import net.aoba.event.listeners.RightMouseUpListener;

public class RightMouseUpEvent extends AbstractEvent{

double mouseX;
double mouseY;

public RightMouseUpEvent(double mouseX2, double mouseY2) {
super();
this.mouseX = mouseX2;
this.mouseY = mouseY2;
}

public double GetMouseX() {
return mouseX;
}

public double GetMouseY() {
return mouseY;
}

@Override
public void Fire(ArrayList<? extends AbstractListener> listeners) {
for(AbstractListener listener : List.copyOf(listeners)) {
RightMouseUpListener mouseRightClickListener = (RightMouseUpListener) listener;
mouseRightClickListener.OnRightMouseUp(this);
}
}

@SuppressWarnings("unchecked")
@Override
public Class<RightMouseUpListener> GetListenerClassType() {
return RightMouseUpListener.class;
}
}
25 changes: 25 additions & 0 deletions src/main/java/net/aoba/event/listeners/RightMouseDownListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Aoba Hacked Client
* Copyright (C) 2019-2024 coltonk9043
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package net.aoba.event.listeners;

import net.aoba.event.events.RightMouseDownEvent;

public interface RightMouseDownListener extends AbstractListener {
public abstract void OnRightMouseDown(RightMouseDownEvent event);
}
25 changes: 25 additions & 0 deletions src/main/java/net/aoba/event/listeners/RightMouseUpListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Aoba Hacked Client
* Copyright (C) 2019-2024 coltonk9043
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package net.aoba.event.listeners;

import net.aoba.event.events.RightMouseUpEvent;

public interface RightMouseUpListener extends AbstractListener {
public abstract void OnRightMouseUp(RightMouseUpEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void draw(DrawContext drawContext, float partialTicks) {
Block block = Registries.BLOCK.get(index);

if(blocks.getValue().contains(block)) {
RenderUtils.drawBox(matrix4f, ((actualX + (j * 36) + 4) / 2.0f), ((actualY + ((i-scroll) * 36) + 25) / 2.0f), 16, 16, new Color(0, 255, 0, 55));
RenderUtils.drawBox(matrix4f, ((actualX + (j * 36) + 4)), ((actualY + ((i-scroll) * 36) + 25)), 32, 32, new Color(0, 255, 0, 55));
}
drawContext.drawItem(new ItemStack(block.asItem()), (int) ((actualX + (j * 36) + 6) / 2.0f), (int) ((actualY + ((i-scroll) * 36) + 25) / 2.0f) );
}
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class ButtonComponent extends Component implements LeftMouseDownListener
private String text;
private Runnable onClick;
private Color borderColor = new Color(128, 128, 128);
private Color backgroundColor = borderColor;
private Color backgroundColor = new Color(96, 96, 96);
private Color hoveredBackgroundColor = new Color(156, 156, 156);

/**
* Constructor for button component.
Expand All @@ -48,6 +49,7 @@ public ButtonComponent(IGuiElement parent, String text, Runnable onClick) {
this.setLeft(2);
this.setRight(2);
this.setHeight(30);
this.setBottom(10);

this.text = text;
this.onClick = onClick;
Expand All @@ -59,6 +61,7 @@ public ButtonComponent(IGuiElement parent, String text, Runnable onClick, Color
this.setLeft(2);
this.setRight(2);
this.setHeight(30);
this.setBottom(10);

this.text = text;
this.onClick = onClick;
Expand Down Expand Up @@ -102,7 +105,11 @@ public void setBackgroundColor(Color color) {
public void draw(DrawContext drawContext, float partialTicks) {
MatrixStack matrixStack = drawContext.getMatrices();
Matrix4f matrix4f = matrixStack.peek().getPositionMatrix();
RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 2, borderColor, backgroundColor);

if(this.hovered)
RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 4, borderColor, hoveredBackgroundColor);
else
RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 4, borderColor, backgroundColor);
RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF);
}

Expand Down
15 changes: 14 additions & 1 deletion src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.aoba.Aoba;
import net.aoba.AobaClient;
import net.aoba.event.events.PlayerHealthEvent;
import net.aoba.gui.GuiManager;
import net.aoba.misc.FakePlayerEntity;
import net.aoba.module.modules.movement.Fly;
import net.aoba.module.modules.movement.Freecam;
import net.aoba.module.modules.movement.HighJump;
import net.aoba.module.modules.movement.Step;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.registry.entry.RegistryEntry;

@Mixin(ClientPlayerEntity.class)
public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntityMixin {
@Shadow
private ClientPlayNetworkHandler networkHandler;

@Inject(at = { @At("HEAD") }, method = "tick()V", cancellable = true)
private void onPlayerTick(CallbackInfo ci) {
if (Aoba.getInstance().moduleManager.freecam.getState()) {
Expand Down Expand Up @@ -104,4 +108,13 @@ public void onGetStepHeight(CallbackInfoReturnable<Float> cir) {
cir.setReturnValue(cir.getReturnValue());
}
}

@Override
public void onGetJumpVelocityMultiplier(CallbackInfoReturnable<Float> cir) {
AobaClient aoba = Aoba.getInstance();
HighJump higherJump = (HighJump)aoba.moduleManager.higherjump;
if(higherJump.getState()) {
cir.setReturnValue(higherJump.getJumpHeightMultiplier());
}
}
}
10 changes: 8 additions & 2 deletions src/main/java/net/aoba/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ private void onIsInvisibleCheck(PlayerEntity message, CallbackInfoReturnable<Boo

@Inject(at = {@At("HEAD")}, method = "damage(Lnet/minecraft/entity/damage/DamageSource;F)Z", cancellable = true)
public void onDamage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> ci) {

return;
}

@Inject(at= {@At("HEAD")}, method = "getStepHeight()F", cancellable=true)
public void onGetStepHeight(CallbackInfoReturnable<Float> cir) {

return;
}

@Inject(at= {@At("HEAD")}, method = "getJumpVelocityMultiplier()F", cancellable=true)
public void onGetJumpVelocityMultiplier(CallbackInfoReturnable<Float> cir) {
return;
}

}
2 changes: 1 addition & 1 deletion src/main/java/net/aoba/mixin/IngameHudMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@Mixin(InGameHud.class)
public class IngameHudMixin {

@Inject(at = {@At(value = "HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V" })
@Inject(at = {@At(value = "TAIL") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V" })
private void onRender(DrawContext context, RenderTickCounter tickDelta, CallbackInfo ci) {
Aoba.getInstance().drawHUD(context, tickDelta.getTickDelta(false));
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/aoba/mixin/LivingEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.entity.LivingEntity;

@Mixin(LivingEntity.class)
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/net/aoba/mixin/MouseMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import net.aoba.AobaClient;
import net.aoba.event.events.MouseMoveEvent;
import net.aoba.event.events.MouseScrollEvent;
import net.aoba.event.events.RightMouseDownEvent;
import net.aoba.event.events.RightMouseUpEvent;
import net.aoba.event.events.LeftMouseDownEvent;
import net.aoba.event.events.LeftMouseUpEvent;
import net.minecraft.client.Mouse;
Expand Down Expand Up @@ -62,7 +64,24 @@ private void onMouseButton(long window, int button, int action, int mods, Callba
}
break;
case GLFW.GLFW_MOUSE_BUTTON_MIDDLE:

break;
case GLFW.GLFW_MOUSE_BUTTON_RIGHT:
if (action == 1) {
RightMouseDownEvent event2 = new RightMouseDownEvent(x, y);
aoba.eventManager.Fire(event2);

if (event2.IsCancelled()) {
ci.cancel();
}
} else {
RightMouseUpEvent event2 = new RightMouseUpEvent(x, y);
aoba.eventManager.Fire(event2);

if (event2.IsCancelled()) {
ci.cancel();
}
}
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/aoba/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class ModuleManager implements KeyDownListener {
public Module chestesp = new ChestESP();
public Module criticals = new Criticals();
public Module crystalaura = new CrystalAura();
public Module clickTP = new ClickTP();
public Module entityesp = new EntityESP();
public Module fastplace = new FastPlace();
public Module fastbreak = new FastBreak();
Expand All @@ -69,6 +70,7 @@ public class ModuleManager implements KeyDownListener {
public Module fullbright = new Fullbright();
public Module itemesp = new ItemESP();
public Module glide = new Glide();
public Module higherjump = new HighJump();
public Module jesus = new Jesus();
public Module jetpack = new Jetpack();
public Module killaura = new KillAura();
Expand Down Expand Up @@ -116,13 +118,15 @@ public ModuleManager() {
addModule(chestesp);
addModule(criticals);
addModule(crystalaura);
addModule(clickTP);
addModule(entityesp);
addModule(fastplace);
addModule(fastbreak);
addModule(fly);
addModule(freecam);
addModule(fullbright);
addModule(glide);
addModule(higherjump);
addModule(itemesp);
addModule(jesus);
addModule(jetpack);
Expand Down
Loading

0 comments on commit 4c366e3

Please sign in to comment.