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

Commit

Permalink
Release 1.4.0
Browse files Browse the repository at this point in the history
- [+] **Add** Phase.
    - Allow you to leave the cage before match start.
    - Thanks to @alan34.
- [+] **Add** CustomName.
    - Allow you to rename modules.
- [+] **Add** CommandChat.
    - Allow you to use raven command by chat.
- [+] **Add** "rename","setBName","say" command.
- [+] **Add** strafeMove option to TargetStrafe.
- [+] **Add** "Watchdog 1.12.2" autoBlock mode to KillAura.
    - ***unverified***
- [※] **Improve** ClickGui.
- [-] **Remove** SaveMoveKeys.
+2 unverified changes.
  • Loading branch information
xia-mc committed Jun 13, 2024
1 parent 5448aee commit d38fc05
Show file tree
Hide file tree
Showing 37 changed files with 1,233 additions and 187 deletions.
3 changes: 2 additions & 1 deletion src/main/java/keystrokesmod/Raven.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import org.jetbrains.annotations.NotNull;

@Mod(
modid = "keystrokes",
Expand Down Expand Up @@ -73,7 +74,7 @@ public void init(FMLInitializationEvent ignored) {
}

@SubscribeEvent
public void onTick(ClientTickEvent e) {
public void onTick(@NotNull ClientTickEvent e) {
if (e.phase == Phase.END) {
if (Utils.nullCheck()) {
if (Reflection.sendMessage) {
Expand Down
54 changes: 32 additions & 22 deletions src/main/java/keystrokesmod/clickgui/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import keystrokesmod.utility.Commands;
import keystrokesmod.utility.Timer;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.font.Font;
import keystrokesmod.utility.font.FontManager;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
Expand All @@ -22,8 +24,8 @@

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.*;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

Expand All @@ -36,23 +38,25 @@ public class ClickGui extends GuiScreen {
private ScaledResolution sr;
private GuiButtonExt s;
private GuiTextField c;
public static ArrayList<CategoryComponent> categories;
private final Font fontRendererObj = FontManager.getMinecraft();
public static Map<Module.category, CategoryComponent> categories;
public static List<Module.category> clickHistory;

public ClickGui() {
categories = new ArrayList<>();
int y = 5;
Module.category[] values;
int length = (values = Module.category.values()).length;

categories = new HashMap<>(length);
clickHistory = new ArrayList<>(length);
for (int i = 0; i < length; ++i) {
Module.category c = values[i];
CategoryComponent f = new CategoryComponent(c);
f.y(y);
categories.add(f);
categories.put(c, f);
clickHistory.add(c);
y += 20;
}


}

public void initMain() {
Expand All @@ -76,13 +80,13 @@ public void drawScreen(int x, int y, float p) {
int h = this.height / 4;
int wd = this.width / 2;
int w_c = 30 - this.aT.getValueInt(0, 30, 3);
this.drawCenteredString(this.fontRendererObj, "r", wd + 1 - w_c, h - 25, Utils.getChroma(2L, 1500L));
this.drawCenteredString(this.fontRendererObj, "a", wd - w_c, h - 15, Utils.getChroma(2L, 1200L));
this.drawCenteredString(this.fontRendererObj, "v", wd - w_c, h - 5, Utils.getChroma(2L, 900L));
this.drawCenteredString(this.fontRendererObj, "e", wd - w_c, h + 5, Utils.getChroma(2L, 600L));
this.drawCenteredString(this.fontRendererObj, "n", wd - w_c, h + 15, Utils.getChroma(2L, 300L));
this.drawCenteredString(this.fontRendererObj, "bS", wd + 1 + w_c, h + 30, Utils.getChroma(2L, 0L));
this.drawCenteredString(this.fontRendererObj, "(xia__mc forked)", wd + 1 + w_c, h + 45, Utils.getChroma(2L, 0L));
this.fontRendererObj.drawCenteredString("r", wd + 1 - w_c, h - 25, Utils.getChroma(2L, 1500L));
this.fontRendererObj.drawCenteredString("a", wd - w_c, h - 15, Utils.getChroma(2L, 1200L));
this.fontRendererObj.drawCenteredString("v", wd - w_c, h - 5, Utils.getChroma(2L, 900L));
this.fontRendererObj.drawCenteredString("e", wd - w_c, h + 5, Utils.getChroma(2L, 600L));
this.fontRendererObj.drawCenteredString("n", wd - w_c, h + 15, Utils.getChroma(2L, 300L));
this.fontRendererObj.drawCenteredString("bS", wd + 1 + w_c, h + 30, Utils.getChroma(2L, 0L));
this.fontRendererObj.drawCenteredString("(xia__mc forked)", wd + 1 + w_c, h + 45, Utils.getChroma(2L, 0L));
this.drawVerticalLine(wd - 10 - w_c, h - 30, h + 43, Color.white.getRGB());
this.drawVerticalLine(wd + 10 + w_c, h - 30, h + 43, Color.white.getRGB());
if (this.aL != null) {
Expand All @@ -92,7 +96,8 @@ public void drawScreen(int x, int y, float p) {
}
}

for (CategoryComponent c : categories) {
for (Module.category category : clickHistory) {
CategoryComponent c = categories.get(category);
c.rf(this.fontRendererObj);
c.up(x, y);

Expand Down Expand Up @@ -139,10 +144,12 @@ public void drawScreen(int x, int y, float p) {
}

public void mouseClicked(int x, int y, int m) throws IOException {
Iterator<CategoryComponent> var4 = categories.iterator();
Iterator<CategoryComponent> var4 = clickHistory.stream()
.map(category -> categories.get(category))
.iterator();

while (true) {
CategoryComponent category;
CategoryComponent category = null;
do {
do {
if (!var4.hasNext()) {
Expand All @@ -151,6 +158,10 @@ public void mouseClicked(int x, int y, int m) throws IOException {
super.mouseClicked(x, y, m);
}

if (category != null) {
clickHistory.remove(category.categoryName);
clickHistory.add(category.categoryName);
}
return;
}

Expand All @@ -174,13 +185,12 @@ public void mouseClicked(int x, int y, int m) throws IOException {
for (Component c : category.getModules()) {
c.onClick(x, y, m);
}

}
}

public void mouseReleased(int x, int y, int s) {
if (s == 0) {
for (CategoryComponent category : categories) {
for (CategoryComponent category : categories.values()) {
category.d(false);
if (category.fv() && !category.getModules().isEmpty()) {
for (Component module : category.getModules()) {
Expand All @@ -196,7 +206,7 @@ public void keyTyped(char t, int k) {
if (k == Keyboard.KEY_ESCAPE && !binding()) {
this.mc.displayGuiScreen(null);
} else {
for (CategoryComponent category : categories) {
for (CategoryComponent category : categories.values()) {
if (category.fv() && !category.getModules().isEmpty()) {
for (Component module : category.getModules()) {
module.keyTyped(t, k);
Expand Down Expand Up @@ -228,7 +238,7 @@ public void onGuiClosed() {
this.sf.cancel(true);
this.sf = null;
}
for (CategoryComponent c : categories) {
for (CategoryComponent c : categories.values()) {
c.dragging = false;
for (Component m : c.getModules()) {
m.onGuiClosed();
Expand All @@ -241,7 +251,7 @@ public boolean doesGuiPauseGame() {
}

private boolean binding() {
for (CategoryComponent c : categories) {
for (CategoryComponent c : categories.values()) {
for (ModuleComponent m : c.getModules()) {
for (Component component : m.settings) {
if (component instanceof BindComponent && ((BindComponent) component).isBinding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.utility.font.Font;
import keystrokesmod.utility.render.RenderUtils;
import keystrokesmod.utility.Timer;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.profile.Manager;
import keystrokesmod.utility.profile.Profile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import org.lwjgl.opengl.GL11;

Expand Down Expand Up @@ -134,7 +134,7 @@ public void mouseClicked(boolean on) {
(this.smoothTimer = new Timer(150)).start();
}

public void rf(FontRenderer renderer) {
public void rf(Font renderer) {
this.k = 92;
int h = 0;
if (!this.modules.isEmpty() && this.categoryOpened) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void render() {
if (this.mod.moduleCategory() == Module.category.profiles && !(this.mod instanceof Manager) && !((ProfileModule) this.mod).saved && Raven.currentProfile.getModule() == this.mod) {
button_rgb = unsavedColor;
}
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.mod.getName(), (float) (this.categoryComponent.getX() + this.categoryComponent.gw() / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.mod.getName()) / 2), (float) (this.categoryComponent.getY() + this.o + 4), button_rgb);
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.mod.getPrettyName(), (float) (this.categoryComponent.getX() + this.categoryComponent.gw() / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.mod.getPrettyName()) / 2), (float) (this.categoryComponent.getY() + this.o + 4), button_rgb);
GL11.glPopMatrix();
if (this.po && !this.settings.isEmpty()) {
for (Component c : this.settings) {
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/keystrokesmod/event/BlockAABBEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package keystrokesmod.event;

import net.minecraft.block.Block;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

@Cancelable
public class BlockAABBEvent extends Event {
private final World world;
private final Block block;
private final BlockPos blockPos;
private AxisAlignedBB boundingBox;
private final AxisAlignedBB maskBoundingBox;

public BlockAABBEvent(World world, Block block, BlockPos blockPos, AxisAlignedBB maskBoundingBox, AxisAlignedBB boundingBox) {
this.world = world;
this.block = block;
this.blockPos = blockPos;
this.maskBoundingBox = maskBoundingBox;
this.boundingBox = boundingBox;
}

public World getWorld() {
return world;
}

public Block getBlock() {
return block;
}

public BlockPos getBlockPos() {
return blockPos;
}

public AxisAlignedBB getBoundingBox() {
return boundingBox;
}

public void setBoundingBox(AxisAlignedBB boundingBox) {
this.boundingBox = boundingBox;
}

public AxisAlignedBB getMaskBoundingBox() {
return maskBoundingBox;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GuiConnecting.class)
public class MixinGuiConnecting extends GuiScreen {
public abstract class MixinGuiConnecting extends GuiScreen {
@Shadow
private NetworkManager networkManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(EntityRenderer.class)
public class MixinEntityRenderer {
public abstract class MixinEntityRenderer {
@Shadow
private Minecraft mc;
@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Mixin(FontRenderer.class)
public class MixinFontRenderer {
public abstract class MixinFontRenderer {
@ModifyVariable(method = "renderString", at = @At("HEAD"), require = 1, ordinal = 0, argsOnly = true)
private String renderString(String string) {
if (string == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.spongepowered.asm.mixin.*;

@Mixin(priority = 995, value = LayerCape.class)
public class MixinLayerCape {
public abstract class MixinLayerCape {
@Mutable
@Final
@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ModelBiped.class)
public class MixinModelBiped {
public abstract class MixinModelBiped {

@Shadow
public ModelRenderer bipedRightArm;
Expand Down
43 changes: 43 additions & 0 deletions src/main/java/keystrokesmod/mixins/impl/world/MixinBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package keystrokesmod.mixins.impl.world;

import keystrokesmod.event.BlockAABBEvent;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
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.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

@Mixin(Block.class)
public abstract class MixinBlock {

@Shadow public abstract AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state);

/**
* @author xia__mc
* @reason for Hypixel Auto Phase (in module phase)
*
*/
@Inject(method = "addCollisionBoxesToList", at = @At("HEAD"), cancellable = true)
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list,
Entity collidingEntity, CallbackInfo ci) {
if (collidingEntity == Minecraft.getMinecraft().thePlayer) {
final AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state);
final BlockAABBEvent event = new BlockAABBEvent(worldIn, (Block)(Object) this, pos, axisalignedbb, mask);
MinecraftForge.EVENT_BUS.post(event);

if (event.isCanceled() || event.getMaskBoundingBox() == null || event.getBoundingBox() == null || !event.getMaskBoundingBox().intersectsWith(event.getBoundingBox())) {
ci.cancel();
}
}
}
}
Loading

0 comments on commit d38fc05

Please sign in to comment.