Skip to content

Commit

Permalink
[+] TpsSync, XCarry. Fixed PolygonMeshPatternRenderer crashing, Separ…
Browse files Browse the repository at this point in the history
…ator setting and sprint mode to AntiHunger
  • Loading branch information
tanishisherewithhh committed Aug 17, 2024
1 parent 42e3782 commit 6836135
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/main/java/dev/heliosclient/managers/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ public static void init() {
new Rotation(),
new Reach(),
new NoBreakDelay(),
new PingSpoof()
new TpsSync(),
new PingSpoof(),
new XCarry()
);

// Render
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
import dev.heliosclient.event.events.player.PacketEvent;
import dev.heliosclient.event.events.player.PlayerJumpEvent;
import dev.heliosclient.managers.ModuleManager;
import dev.heliosclient.mixin.AccessorPlayerPositionLookS2CPacket;
import dev.heliosclient.module.Categories;
import dev.heliosclient.module.Module_;
import dev.heliosclient.module.modules.movement.AutoJump;
import dev.heliosclient.module.settings.BooleanSetting;
import dev.heliosclient.module.settings.DoubleSetting;
import dev.heliosclient.module.settings.SettingGroup;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;

public class AntiHunger extends Module_ {
SettingGroup sgGeneral = new SettingGroup("General");

BooleanSetting sprint = sgGeneral.add(new BooleanSetting.Builder()
.name("Cancel Sprint")
.description("No sprint +")
.defaultValue(false)
.onSettingChange(this)
.build()
);
BooleanSetting suppressJumping = sgGeneral.add(new BooleanSetting.Builder()
.name("Suppress Jumping")
.description("Prevents you from jumping if your hunger is below a certain threshold to save hunger")
Expand Down Expand Up @@ -43,11 +52,10 @@ public AntiHunger() {

@SubscribeEvent
public void packetSendEvent(PacketEvent.SEND event) {

if (mc.player == null || mc.player.hasVehicle() || mc.player.isTouchingWater() || mc.player.isSubmergedInWater())
return;

if (event.packet instanceof ClientCommandC2SPacket p && p.getMode() == ClientCommandC2SPacket.Mode.START_SPRINTING) {
if (sprint.value && event.packet instanceof ClientCommandC2SPacket p && p.getMode() == ClientCommandC2SPacket.Mode.START_SPRINTING) {
event.setCanceled(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class NoBreakDelay extends Module_ {
public NoBreakDelay() {
super("NoBreakDelay", "Modifies your breaking cooldown", Categories.PLAYER);
addSettingGroup(sgGeneral);

addQuickSetting(breakDelay);

}
}
43 changes: 43 additions & 0 deletions src/main/java/dev/heliosclient/module/modules/player/TpsSync.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package dev.heliosclient.module.modules.player;

import dev.heliosclient.event.SubscribeEvent;
import dev.heliosclient.event.events.TickEvent;
import dev.heliosclient.event.events.player.PacketEvent;
import dev.heliosclient.managers.ModuleManager;
import dev.heliosclient.module.Categories;
import dev.heliosclient.module.Module_;
import dev.heliosclient.module.modules.world.Timer;
import dev.heliosclient.module.settings.BooleanSetting;
import dev.heliosclient.module.settings.SettingGroup;
import dev.heliosclient.system.TickRate;
import dev.heliosclient.util.TimerUtils;
import dev.heliosclient.util.player.BlockIterator;
import net.minecraft.block.Blocks;
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
import net.minecraft.util.math.BlockPos;

public class TpsSync extends Module_ {

public TpsSync() {
super("TpsSync", "Syncs you and your actions with the server TPS", Categories.PLAYER);
}
@Override
public void onDisable() {
super.onDisable();
ModuleManager.get(Timer.class).setOverride(Timer.RESET);
}

@SubscribeEvent
public void onTick(TickEvent.PLAYER event) {
Timer timer = ModuleManager.get(Timer.class);
if (timer.isActive()) return;

if(TickRate.INSTANCE.getTPS() > 1){
timer.setOverride(TickRate.INSTANCE.getTPS() / 20f);
}else{
timer.setOverride(Timer.RESET);
}
}


}
19 changes: 19 additions & 0 deletions src/main/java/dev/heliosclient/module/modules/player/XCarry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package dev.heliosclient.module.modules.player;

import dev.heliosclient.event.SubscribeEvent;
import dev.heliosclient.event.events.player.PacketEvent;
import dev.heliosclient.module.Categories;
import dev.heliosclient.module.Module_;
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;

public class XCarry extends Module_ {
public XCarry() {
super("XCarry","eXtra carry in your crafting and other slots", Categories.PLAYER);
}

@SubscribeEvent
public void onPaketSend(PacketEvent.SEND e) {
if (e.packet instanceof CloseHandledScreenC2SPacket)
e.setCanceled(true);
}
}
2 changes: 2 additions & 0 deletions src/main/java/dev/heliosclient/module/settings/Option.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.heliosclient.module.settings;


//what is this anyone explain pls.
public class Option<T> {
private String name;
private T value;
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/dev/heliosclient/module/settings/Separator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

import java.util.function.BooleanSupplier;

public class Separator extends Setting<Boolean> {
public class Separator extends Setting<Void> {

public Separator(int height, BooleanSupplier shouldRender, boolean defaultValue) {
super(shouldRender, defaultValue);
public Separator(int height, BooleanSupplier shouldRender) {
super(shouldRender, (Void) null);
this.value = null;
this.height = height;
}

Expand All @@ -23,4 +24,8 @@ public void renderCompact(DrawContext drawContext, int x, int y, int mouseX, int
Renderer2D.drawRectangle(drawContext.getMatrices().peek().getPositionMatrix(), x + 2, y + (float) heightCompact / 2, getWidthCompact() - 2, 1, 0xCCFFFFFF);
}

@Override
public Void get() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public Vector3dSetting(String name, String description, BooleanSupplier shouldRe
this.height = xSet.height + ySet.height + zSet.height + 10;
this.heightCompact = xSet.heightCompact + ySet.heightCompact + zSet.heightCompact + 5;

//Result of bad coding.... ugghhhh. I am gonna replace this with scale based animation later.
//Todo
xSet.setAnimationDone(true);
xSet.setAnimationProgress(1.0f);
ySet.setAnimationDone(true);
ySet.setAnimationProgress(1.0f);
zSet.setAnimationDone(true);
zSet.setAnimationProgress(1.0f);


}

public Vector3dSetting(String name, String description, BooleanSupplier shouldRender, Vec3d defaultValue, double min, double max, int roundingPlace, ISettingChange settingChange) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PolygonMeshPatternRenderer {
private static final Random random = new Random();
public static PolygonMeshPatternRenderer INSTANCE = new PolygonMeshPatternRenderer();
private int NUM_POINTS = 75;
private final Point[] points = new Point[NUM_POINTS];
private Point[] points = new Point[NUM_POINTS];
public float MAX_DISTANCE = 75.0f;
public float radius = 2f;
public GradientManager.Gradient maskGradient = GradientManager.getGradient("Linear2D");
Expand All @@ -29,6 +29,8 @@ public void create() {
height = MinecraftClient.getInstance().getWindow().getScaledHeight();
}

points = new Point[NUM_POINTS];

for (int i = 0; i < NUM_POINTS; i++) {
points[i] = new Point(random.nextFloat() * width, random.nextFloat() * height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Map;

public interface ISaveAndLoad {
//Json Serializar??? Never heard of it. Seriously, someone fix this abomination.
Object saveToFile(List<Object> list);

void loadFromFile(Map<String, Object> MAP);
Expand Down

0 comments on commit 6836135

Please sign in to comment.