Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Release 1.22.0 (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-mc authored Aug 3, 2024
1 parent 605c98c commit 4a24587
Show file tree
Hide file tree
Showing 63 changed files with 1,200 additions and 288 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'java'

group = "keystrokesmod"
archivesBaseName = "raven-XD"
//version = "1.21-dev"
//version = "1.22-dev"

compileJava {
sourceCompatibility = '1.8'
Expand Down
17 changes: 13 additions & 4 deletions src/main/java/keystrokesmod/clickgui/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.font.FontManager;
import keystrokesmod.utility.font.impl.MinecraftFontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.lwjgl.input.Keyboard;
Expand All @@ -43,6 +40,7 @@ public class ClickGui extends GuiScreen {
private final MinecraftFontRenderer fontRendererObj = FontManager.getMinecraft();
public static Map<Module.category, CategoryComponent> categories;
public static List<Module.category> clickHistory;
private Runnable delayedAction = null;

public ClickGui() {
int y = 5;
Expand All @@ -61,6 +59,14 @@ public ClickGui() {
}
}

public FontRenderer getFont() {
return super.fontRendererObj;
}

public void run(Runnable task) {
delayedAction = task;
}

public void initMain() {
(this.aT = this.aE = this.aR = new Timer(500.0F)).start();
this.sf = Raven.getExecutor().schedule(() -> (this.aL = new Timer(650.0F)).start(), 650L, TimeUnit.MILLISECONDS);
Expand Down Expand Up @@ -142,6 +148,9 @@ public void drawScreen(int x, int y, float p) {
CommandLine.b = false;
}

if (delayedAction != null)
delayedAction.run();
delayedAction = null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package keystrokesmod.clickgui.components;

import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.impl.*;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.module.setting.Setting;
import keystrokesmod.module.setting.impl.*;
import keystrokesmod.utility.render.RenderUtils;
import net.minecraftforge.fml.client.config.GuiUtils;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.util.Collections;
import java.util.NoSuchElementException;

public abstract class Component implements IComponent {
Expand All @@ -31,6 +36,10 @@ public final void drawScreen(int x, int y) {
color = hover ? HOVER_COLOR : DEFAULT_COLOR;
toggleColor = hover ? TOGGLE_HOVER_COLOR : TOGGLE_DEFAULT_COLOR;
onDrawScreen(x, y);

if (getSetting() != null && hover && getSetting().isVisible() && getParent().po && Gui.toolTip.isToggled() && getSetting().toolTip != null) {
Raven.clickGui.run(() -> RenderUtils.drawToolTip(getSetting().toolTip, x, y));
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import keystrokesmod.utility.profile.Profile;
import keystrokesmod.utility.render.Animation;
import keystrokesmod.utility.render.Easing;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import org.lwjgl.opengl.GL11;
Expand All @@ -26,6 +27,7 @@
public class CategoryComponent {
public List<ModuleComponent> modules = new CopyOnWriteArrayList<>();
public Module.category categoryName;
@Getter
private boolean categoryOpened;
private Timer smoothTimer;
private int width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.clickgui.components.IComponent;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.module.setting.Setting;
import keystrokesmod.utility.render.RenderUtils;
import keystrokesmod.utility.profile.Manager;
Expand Down Expand Up @@ -168,15 +169,19 @@ public void onDrawScreen(int x, int y) {
c.drawScreen(x, y);
}
}
hovering = ii(x, y);
hovering = isHover(x, y);

if (hovering && categoryComponent.isCategoryOpened() && Gui.toolTip.isToggled() && mod.toolTip != null) {
Raven.clickGui.run(() -> RenderUtils.drawToolTip(mod.toolTip, x, y));
}
}

public String getName() {
return mod.getName();
}

public void onClick(int x, int y, int b) {
if (this.ii(x, y) && b == 0 && this.mod.canBeEnabled()) {
if (this.isHover(x, y) && b == 0 && this.mod.canBeEnabled()) {
this.mod.toggle();
if (this.mod.moduleCategory() != Module.category.profiles) {
if (Raven.currentProfile != null) {
Expand All @@ -185,7 +190,7 @@ public void onClick(int x, int y, int b) {
}
}

if (this.ii(x, y) && b == 1) {
if (this.isHover(x, y) && b == 1) {
this.po = !this.po;
this.categoryComponent.render();
}
Expand Down Expand Up @@ -214,7 +219,7 @@ public void onGuiClosed() {
}
}

public boolean ii(int x, int y) {
public boolean isHover(int x, int y) {
return x > this.categoryComponent.getX() && x < this.categoryComponent.getX() + this.categoryComponent.gw() && y > this.categoryComponent.getY() + this.o && y < this.categoryComponent.getY() + 16 + this.o;
}
}
19 changes: 19 additions & 0 deletions src/main/java/keystrokesmod/event/BlockWebEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package keystrokesmod.event;


import lombok.AllArgsConstructor;
import lombok.Getter;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.BlockPos;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

@Getter
@Cancelable
@AllArgsConstructor
public class BlockWebEvent extends Event {
private final BlockPos blockPos;
private final IBlockState blockState;
private final Entity entity;
}
14 changes: 6 additions & 8 deletions src/main/java/keystrokesmod/event/SendPacketEvent.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package keystrokesmod.event;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.network.Packet;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

@Setter
@Getter
@Cancelable
@AllArgsConstructor
public class SendPacketEvent extends Event {
private Packet<?> packet;

public SendPacketEvent(Packet<?> packet) {
this.packet = packet;
}

public Packet<?> getPacket() {
return packet;
}
}
27 changes: 27 additions & 0 deletions src/main/java/keystrokesmod/mixins/impl/world/MixinBlockWeb.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package keystrokesmod.mixins.impl.world;


import keystrokesmod.event.BlockWebEvent;
import net.minecraft.block.BlockWeb;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
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(BlockWeb.class)
public class MixinBlockWeb {

@Inject(method = "onEntityCollidedWithBlock", at = @At("HEAD"), cancellable = true)
public void onEntityCollidedWithBlock(World world, BlockPos blockPos, IBlockState state, Entity entity, CallbackInfo ci) {
BlockWebEvent event = new BlockWebEvent(blockPos, state, entity);
MinecraftForge.EVENT_BUS.post(event);

if (event.isCanceled())
ci.cancel();
}
}
28 changes: 13 additions & 15 deletions src/main/java/keystrokesmod/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.FMLCommonHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;

Expand All @@ -29,6 +30,7 @@ public class Module {
@Setter
private boolean enabled;
private int keycode;
public @Nullable String toolTip;
protected static Minecraft mc;
private boolean isToggled = false;
public boolean canBeEnabled = true;
Expand All @@ -39,10 +41,15 @@ public class Module {
public Script script = null;

public Module(String moduleName, Module.category moduleCategory, int keycode) {
this(moduleName, moduleCategory, keycode, null);
}

public Module(String moduleName, Module.category moduleCategory, int keycode, @Nullable String toolTip) {
this.moduleName = moduleName;
this.prettyName = moduleName;
this.moduleCategory = moduleCategory;
this.keycode = keycode;
this.toolTip = toolTip;
this.enabled = false;
mc = Minecraft.getMinecraft();
this.settings = new ArrayList<>();
Expand All @@ -64,24 +71,15 @@ public static Module getModule(Class<? extends Module> a) {
}

public Module(String name, Module.category moduleCategory) {
this.moduleName = name;
this.prettyName = name;
this.moduleCategory = moduleCategory;
this.keycode = 0;
this.enabled = false;
mc = Minecraft.getMinecraft();
this.settings = new ArrayList<>();
this(name, moduleCategory, null);
}

public Module(String name, Module.category moduleCategory, String toolTip) {
this(name, moduleCategory, 0, toolTip);
}

public Module(@NotNull Script script) {
super();
this.enabled = false;
this.moduleName = script.name;
this.prettyName = script.name;
this.script = script;
this.keycode = 0;
this.moduleCategory = category.scripts;
this.settings = new ArrayList<>();
this(script.name, category.scripts);
}

public void keybind() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public class ModuleManager {
public static ViewPackets viewPackets;
public static ArmedAura armedAura;
public static HitLog hitLog;
public static LagRange lagRange;
public static FakePotion fakePotion;
public static NoWeb noWeb;

public void register() {

Expand Down Expand Up @@ -133,6 +136,7 @@ public void register() {
this.addModule(killAura = new KillAura());
this.addModule(killAuraV2 = new KillAuraV2());
this.addModule(armedAura = new ArmedAura());
this.addModule(lagRange = new LagRange());
this.addModule(moreKB = new MoreKB());
this.addModule(reach = new Reach());
this.addModule(new RodAimbot());
Expand Down Expand Up @@ -171,6 +175,7 @@ public void register() {
this.addModule(new VClip());
this.addModule(wallClimb = new WallClimb());
this.addModule(jesus = new Jesus());
this.addModule(noWeb = new NoWeb());

// other
this.addModule(new Anticheat());
Expand Down Expand Up @@ -207,6 +212,7 @@ public void register() {
this.addModule(invManager = new InvManager());
this.addModule(noFall = new NoFall());
this.addModule(new NoRotate());
this.addModule(fakePotion = new FakePotion());

// render
this.addModule(ambience = new Ambience());
Expand Down Expand Up @@ -240,6 +246,7 @@ public void register() {
this.addModule(new BedPlates());
this.addModule(watermark = new Watermark());
this.addModule(new Explosions());
this.addModule(new KillMessage());

// world
this.addModule(antiBot = new AntiBot());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/keystrokesmod/module/impl/client/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import keystrokesmod.utility.Utils;

public class Gui extends Module {
public static ButtonSetting removePlayerModel, resetPosition, translucentBackground, removeWatermark, rainBowOutlines;
public static ButtonSetting removePlayerModel, resetPosition, translucentBackground, removeWatermark, rainBowOutlines, toolTip;
// public static SliderSetting font;

public Gui() {
Expand All @@ -16,6 +16,7 @@ public Gui() {
this.registerSetting(removePlayerModel = new ButtonSetting("Remove player model", false));
this.registerSetting(removeWatermark = new ButtonSetting("Remove watermark", false));
this.registerSetting(translucentBackground = new ButtonSetting("Translucent background", true));
this.registerSetting(toolTip = new ButtonSetting("Tool tip", true));
this.registerSetting(resetPosition = new ButtonSetting("Reset position", ClickGui::resetPosition));
// this.registerSetting(font = new SliderSetting("Font", new String[]{"Minecraft", "Product Sans"}, 0));
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/keystrokesmod/module/impl/combat/AimAssist.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class AimAssist extends Module {
private final ModeValue mode;

public AimAssist() {
super("AimAssist", category.combat, 0);
super("AimAssist", category.combat, "Smoothly aims to closet valid target");
this.registerSetting(mode = new ModeValue("Mode", this)
.add(new OriginalAimAssist("Original", this))
.add(new TejasAssist("TejasAssist", this))
.add(new OriginalAimAssist("Normal", this))
.add(new TejasAssist("Tejas", this))
.setDefaultValue("Original"));
}

Expand Down
Loading

0 comments on commit 4a24587

Please # to comment.