Skip to content

Commit

Permalink
fix kioshi love
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvrwed committed Mar 29, 2024
1 parent 65774cc commit 495d6d7
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 114 deletions.
1 change: 1 addition & 0 deletions src/main/java/cc/unknown/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public ModuleManager() {
new ChatBypass(),
new PingSpoof(),
new FakeLag(),
new Test(),

// other
new Autoplay(),
Expand Down
24 changes: 14 additions & 10 deletions src/main/java/cc/unknown/module/impl/combat/AutoBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import cc.unknown.module.impl.ModuleCategory;
import cc.unknown.module.setting.impl.BooleanValue;
import cc.unknown.module.setting.impl.DoubleSliderValue;
import cc.unknown.module.setting.impl.ModeValue;
import cc.unknown.utils.helpers.MathHelper;
import cc.unknown.utils.player.CombatUtil;
import cc.unknown.utils.player.PlayerUtil;
import net.minecraft.client.settings.KeyBinding;

public class AutoBlock extends Module {

private ModeValue mode = new ModeValue("Mode", "Basic", "Basic");
private BooleanValue limitTarget = new BooleanValue("Limit target", false);
private BooleanValue limitCps = new BooleanValue("Limit cps", false);
private DoubleSliderValue blockCps = new DoubleSliderValue("Limit Cps", 16, 19, 1, 30, 1);
Expand All @@ -21,22 +23,24 @@ public class AutoBlock extends Module {

public AutoBlock() {
super("AutoBlock", ModuleCategory.Combat);
this.registerSetting(limitTarget, limitCps, blockCps);
this.registerSetting(mode, limitTarget, limitCps, blockCps);
}

@EventLink
public void onRender(Render3DEvent e) {
if (!limitTarget.isToggled() || CombatUtil.instance.canTarget(mc.objectMouseOver.entityHit)) {
if (mc.gameSettings.keyBindAttack.isKeyDown() && !mc.gameSettings.keyBindUseItem.isKeyDown() && PlayerUtil.isHoldingWeapon() && mc.objectMouseOver.entityHit != null) {
if (limitCps.isToggled()) {
if (System.currentTimeMillis() - lastBlock >= blockDelay) {
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
if (mode.is("Basic")) {
if (!limitTarget.isToggled() || CombatUtil.instance.canTarget(mc.objectMouseOver.entityHit)) {
if (mc.gameSettings.keyBindAttack.isKeyDown() && !mc.gameSettings.keyBindUseItem.isKeyDown() && PlayerUtil.isHoldingWeapon() && mc.objectMouseOver.entityHit != null) {
if (limitCps.isToggled()) {
if (System.currentTimeMillis() - lastBlock >= blockDelay) {
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());

lastBlock = System.currentTimeMillis();
blockDelay = MathHelper.randomClickDelay(blockCps.getInputMinToInt(), blockCps.getInputMaxToInt());
lastBlock = System.currentTimeMillis();
blockDelay = MathHelper.randomClickDelay(blockCps.getInputMinToInt(), blockCps.getInputMaxToInt());
}
} else {
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
}
} else {
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/cc/unknown/module/impl/combat/AutoClick.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class AutoClick extends Module {
private final BooleanValue breakBlocks = new BooleanValue("Break blocks", false);
private final BooleanValue hitSelect = new BooleanValue("Hit select", false);
private final SliderValue hitSelectDistance = new SliderValue("Hit select distance", 10, 1, 20, 5);
private final SliderValue hitSelectDelay = new SliderValue("Hit select delay", 50, 50, 500, 25);
private final BooleanValue invClicker = new BooleanValue("Inv clicker", false);
private final SliderValue invDelay = new SliderValue("Inv delay", 5, 0, 10, 1);

Expand All @@ -44,7 +43,7 @@ public class AutoClick extends Module {

public AutoClick() {
super("AutoClick", ModuleCategory.Combat);
this.registerSetting(leftClick, leftCPS, weaponOnly, breakBlocks, hitSelect, hitSelectDistance, hitSelectDelay,
this.registerSetting(leftClick, leftCPS, weaponOnly, breakBlocks, hitSelect, hitSelectDistance,
invClicker, invDelay, rightClick, rightCPS, onlyBlocks, allowEat, allowBow, clickEvent, clickStyle);
}

Expand Down Expand Up @@ -168,10 +167,6 @@ public BooleanValue getOnlyBlocks() {
return onlyBlocks;
}

public SliderValue getHitSelectDelay() {
return hitSelectDelay;
}

private void inInvClick(GuiScreen gui) {
int x = Mouse.getX() * gui.width / mc.displayWidth;
int y = gui.height - Mouse.getY() * gui.height / mc.displayHeight - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cc/unknown/module/impl/combat/AutoRod.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AutoRod extends Module {
private final BooleanValue ignoreOnEnemyLowHealth = new BooleanValue("Ignore enemy low health", true);
private final BooleanValue healthFromScoreboard = new BooleanValue("Health from scoreboard", false);
private final BooleanValue absorption = new BooleanValue("Absorption", false);
private final SliderValue activationDistance = new SliderValue("Activation distance", 8, 1, 20, 1);
private final SliderValue activationDistance = new SliderValue("Enemy Distance", 8, 1, 20, 1);
private final SliderValue enemiesNearby = new SliderValue("Multi Target", 1, 1, 5, 1);
private final SliderValue playerHealth = new SliderValue("Player health", 5, 1, 20, 1);
private final SliderValue enemyHealth = new SliderValue("Enemy health", 5, 1, 20, 1);
Expand Down
81 changes: 7 additions & 74 deletions src/main/java/cc/unknown/module/impl/exploit/FakeLag.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package cc.unknown.module.impl.exploit;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

import cc.unknown.event.impl.EventLink;
import cc.unknown.event.impl.move.LivingUpdateEvent;
import cc.unknown.event.impl.move.PreUpdateEvent;
import cc.unknown.event.impl.network.DisconnectionEvent;
import cc.unknown.event.impl.network.PacketEvent;
Expand All @@ -21,21 +21,16 @@
import cc.unknown.module.Module;
import cc.unknown.module.impl.ModuleCategory;
import cc.unknown.module.setting.impl.BooleanValue;
import cc.unknown.module.setting.impl.DoubleSliderValue;
import cc.unknown.module.setting.impl.ModeValue;
import cc.unknown.module.setting.impl.SliderValue;
import cc.unknown.ui.clickgui.raven.impl.api.Theme;
import cc.unknown.utils.client.RenderUtil;
import cc.unknown.utils.helpers.MathHelper;
import cc.unknown.utils.network.PacketUtil;
import cc.unknown.utils.network.TimedPacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.play.INetHandlerPlayServer;
import net.minecraft.network.play.client.C00PacketKeepAlive;
import net.minecraft.network.play.client.C02PacketUseEntity;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.network.play.server.S13PacketDestroyEntities;
Expand All @@ -48,13 +43,12 @@
@SuppressWarnings("unchecked")
public class FakeLag extends Module {

private ModeValue mode = new ModeValue("Mode", "Latency", "Tick", "Latency");
private BooleanValue onlyCombat = new BooleanValue("Only combat", true);
private BooleanValue renderPosition = new BooleanValue("Render actual position", true);
private ModeValue mode = new ModeValue("Mode", "Latency", "Latency");
private SliderValue latency = new SliderValue("Latency delay", 200, 1, 1000, 1);
private SliderValue enemyDistance = new SliderValue("Enemy Distance", 4.0, 3.0, 6.0, 0.1);
private DoubleSliderValue tick = new DoubleSliderValue("Ticks delay", 3, 4, 1, 20, 1);
private BooleanValue legitimize = new BooleanValue("Cancel C03", true);
private BooleanValue onlyCombat = new BooleanValue("Only combat", true);
private BooleanValue renderPosition = new BooleanValue("Render player position", true);
private SliderValue boxColor = new SliderValue("Box Color [H/S/B]", 0, 0, 350, 10);
private BooleanValue onWorld = new BooleanValue("Disable on world change", true);

private final List<Packet<INetHandlerPlayServer>> packets = new ArrayList<>();
Expand All @@ -65,7 +59,7 @@ public class FakeLag extends Module {

public FakeLag() {
super("FakeLag", ModuleCategory.Exploit);
this.registerSetting(mode, onlyCombat, renderPosition, latency, enemyDistance, tick, legitimize, onWorld);
this.registerSetting(mode, latency, enemyDistance, onlyCombat, renderPosition, boxColor, onWorld);
}

@Override
Expand All @@ -81,12 +75,6 @@ public void onEnable() {
vec3 = lastVec3 = null;
target = null;
}

if (mode.is("Tick")) {
synchronized (packets) {
packets.clear();
}
}
}

@Override
Expand All @@ -103,17 +91,6 @@ public void onDisable() {
packetQueue.clear();
}

if (mode.is("Tick")) {
List<Packet<INetHandlerPlayServer>> c;
synchronized (packets) {
c = new ArrayList<>(packets);
packets.clear();
}

for (Packet<INetHandlerPlayServer> packet : c) {
PacketUtil.sendPacketNoEvent(packet);
}
}
}

@EventLink
Expand All @@ -139,23 +116,6 @@ public void onPreTick(TickEvent.Pre e) {
release();
}

@EventLink
public void onUpdate(LivingUpdateEvent e) {
if (mode.is("Tick")) {
List<Packet<INetHandlerPlayServer>> c;

synchronized (packets) {
c = new ArrayList<>(packets);
if (mc.thePlayer.ticksExisted
% MathHelper.randomInt(tick.getInputMinToInt(), tick.getInputMaxToInt()) == 0) {
for (int i = 0; i < c.size(); i++) {
PacketUtil.send(c.get(i));
}
}
}
}
}

@EventLink
public void onWorld(WorldEvent e) {
if (onWorld.isToggled()) {
Expand All @@ -169,7 +129,7 @@ public void onRender3D(Render3DEvent event) {
return;

if (renderPosition.isToggled()) {
RenderUtil.drawBox(target, vec3, lastVec3, Theme.getMainColor(), false);
RenderUtil.drawBox(target, vec3, lastVec3, Color.getHSBColor((boxColor.getInputToFloat() % 360) / 360.0f, 1.0f, 1.0f), false);
}
}

Expand Down Expand Up @@ -248,33 +208,6 @@ public void onPacket(PacketEvent e) {
}
}

if (mode.is("Tick")) {
synchronized (packets) {
if (mode.is("Tick") && packets.contains(e.getPacket())) {
packets.remove(e.getPacket());
return;
}

if (mode.is("Tick")) {
packets.add((Packet<INetHandlerPlayServer>) e.getPacket());
e.setCancelled(true);
return;
}

if (legitimize.isToggled()) {
if (e.getPacket() instanceof C03PacketPlayer) {
packets.add((Packet<INetHandlerPlayServer>) e.getPacket());
e.setCancelled(true);
}
} else {
if (!(e.getPacket() instanceof C00PacketKeepAlive)) {
packets.add((Packet<INetHandlerPlayServer>) e.getPacket());
e.setCancelled(true);
}
}
}
}

if (e.getPacket() instanceof C02PacketUseEntity) {
C02PacketUseEntity wrapper = (C02PacketUseEntity) e.getPacket();
if (onlyCombat.isToggled() && wrapper.getAction() != C02PacketUseEntity.Action.ATTACK)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/cc/unknown/module/impl/player/FastPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import cc.unknown.utils.player.PlayerUtil;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemEgg;
import net.minecraft.item.ItemFishingRod;
import net.minecraft.item.ItemSnowball;
import net.minecraft.item.ItemStack;

Expand All @@ -33,6 +34,9 @@ public boolean canBeEnabled() {
public void onPlayerTick(TickEvent e) {
if (PlayerUtil.inGame() && mc.inGameHasFocus) {
ItemStack item = mc.thePlayer.getHeldItem();
if(item.getItem() instanceof ItemFishingRod) {
return;
}

if (!pitchCheck.isToggled() || !(mc.thePlayer.rotationPitch < 70.0F)) {
if (blockOnly.isToggled() && item != null) {
Expand Down
16 changes: 3 additions & 13 deletions src/main/java/cc/unknown/module/impl/settings/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,19 @@

public class Colors extends Module {

private SliderValue arrayColor = new SliderValue("Array Color [H/S/B]", 0, 0, 350, 10);
private SliderValue clickGuiColor = new SliderValue("ClickGui Color [H/S/B]", 0, 0, 350, 10);
private SliderValue saturation = new SliderValue("Saturation [H/S/B]", 1.0, 0.6, 1.0, 0.1);
private SliderValue brightness = new SliderValue("Brightness [H/S/B]", 1.0, 0.6, 1.0, 0.1);
private SliderValue saturation = new SliderValue("Saturation [H/S/B]", 1.0, 0.0, 1.0, 0.1);
private SliderValue brightness = new SliderValue("Brightness [H/S/B]", 1.0, 0.0, 1.0, 0.1);

public Colors() {
super("Custom Colors", ModuleCategory.Settings);
this.registerSetting(arrayColor, clickGuiColor, saturation, brightness);
this.registerSetting(saturation, brightness);
onEnable();
}

@Override
public boolean canBeEnabled() {
return false;
}

public SliderValue getArrayColor() {
return arrayColor;
}

public SliderValue getClickGuiColor() {
return clickGuiColor;
}

public SliderValue getSaturation() {
return saturation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cc.unknown.module.impl.ModuleCategory;
import cc.unknown.module.setting.impl.BooleanValue;
import cc.unknown.module.setting.impl.ModeValue;
import cc.unknown.module.setting.impl.SliderValue;
import cc.unknown.ui.clickgui.raven.ClickGui;
import cc.unknown.utils.player.PlayerUtil;
import net.minecraft.client.settings.GameSettings;
Expand All @@ -17,11 +18,12 @@ public class ClickGuiModule extends Module {
public ModeValue clientTheme = new ModeValue("Color", "Static", "Rainbow", "Pastel", "Memories", "Lilith", "Static");
public ModeValue waifuMode = new ModeValue("Waifu", "Kurumi", "Kurumi", "Uzaki", "Megumin", "Mai", "Ai", "Elf", "Magic", "Kumi", "None");
public BooleanValue gradient = new BooleanValue("BackGround Gradient", false);
public SliderValue clickGuiColor = new SliderValue("ClickGui Color [H/S/B]", 0, 0, 350, 10);
private final KeyBinding[] moveKeys = new KeyBinding[]{mc.gameSettings.keyBindForward, mc.gameSettings.keyBindBack, mc.gameSettings.keyBindRight, mc.gameSettings.keyBindLeft, mc.gameSettings.keyBindJump, mc.gameSettings.keyBindSprint, mc.gameSettings.keyBindSneak};

public ClickGuiModule() {
super("ClickGui", ModuleCategory.Visuals);
this.registerSetting(clientTheme, waifuMode, gradient);
this.registerSetting(clientTheme, waifuMode, gradient, clickGuiColor);
this.withKeycode(54, ClickGuiModule.class);
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/cc/unknown/module/impl/visuals/HUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import cc.unknown.module.impl.settings.Colors;
import cc.unknown.module.setting.impl.BooleanValue;
import cc.unknown.module.setting.impl.ModeValue;
import cc.unknown.module.setting.impl.SliderValue;
import cc.unknown.ui.clickgui.EditHudPositionScreen;
import cc.unknown.ui.clickgui.raven.ClickGui;
import cc.unknown.ui.clickgui.raven.impl.api.Theme;
Expand All @@ -29,6 +30,7 @@
public class HUD extends Module {
private ModeValue colorMode = new ModeValue("ArrayList Theme", "Static", "Static", "Slinky", "Astolfo", "Primavera",
"Ocean", "Theme");
private SliderValue arrayColor = new SliderValue("Array Color [H/S/B]", 0, 0, 350, 10);
private BooleanValue editPosition = new BooleanValue("Edit Position", false);
public BooleanValue alphabeticalSort = new BooleanValue("Alphabetical Sort", false);
private BooleanValue noRenderModules = new BooleanValue("No Render Modules", true);
Expand All @@ -37,7 +39,7 @@ public class HUD extends Module {

public HUD() {
super("Hud", ModuleCategory.Visuals);
this.registerSetting(colorMode, editPosition, alphabeticalSort, noRenderModules, background, customFont);
this.registerSetting(colorMode, arrayColor, editPosition, alphabeticalSort, noRenderModules, background, customFont);
}

@Override
Expand Down Expand Up @@ -108,7 +110,7 @@ public void onDraw(Render2DEvent e) {
Colors col = (Colors) Haru.instance.getModuleManager().getModule(Colors.class);
switch (colorMode.getMode()) {
case "Static":
color.set(Color.getHSBColor((col.getArrayColor().getInputToFloat() % 360) / 360.0f,
color.set(Color.getHSBColor((arrayColor.getInputToFloat() % 360) / 360.0f,
col.getSaturation().getInputToFloat(), col.getBrightness().getInputToFloat()).getRGB());
y.addAndGet(mc.fontRendererObj.FONT_HEIGHT + margin);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static Color getMainColor() {
case "Memories":
return ColorUtil.reverseGradientDraw(new Color(255, 0, 255), new Color(255, 255, 0), new Color(255, 0, 158), 2);
case "Static":
return Color.getHSBColor((col.getClickGuiColor().getInputToFloat() % 360) / 360.0f, col.getSaturation().getInputToFloat(), col.getBrightness().getInputToFloat());
return Color.getHSBColor((clickgui.clickGuiColor.getInputToFloat() % 360) / 360.0f, col.getSaturation().getInputToFloat(), col.getBrightness().getInputToFloat());

}
return null;
Expand Down
Loading

0 comments on commit 495d6d7

Please sign in to comment.