Skip to content

Commit

Permalink
2.4.1 (#5)
Browse files Browse the repository at this point in the history
* Delete src/main directory

* Autoclicker
  • Loading branch information
tanishisherewithhh committed Mar 11, 2023
1 parent 9c26b52 commit ec185b3
Show file tree
Hide file tree
Showing 23 changed files with 745 additions and 199 deletions.
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ repositories {
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
maven {
url "https://maven.jamieswhiteshirt.com/libs-release"
content {
includeGroup "com.jamieswhiteshirt"
}
}
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
}
Expand All @@ -35,7 +29,6 @@ dependencies {

// Mod Menu
modApi "com.terraformersmc:modmenu:5.0.2"
include modImplementation("com.jamieswhiteshirt:reach-entity-attributes:2.3.1")
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.14.13

# Mod Properties
mod_version = 2.4.0
mod_version = 2.4.1
maven_group = net.smphack
archives_base_name = smp-hack

Expand Down
197 changes: 38 additions & 159 deletions src/main/java/net/fabricmc/smphack/HUDoverlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,49 @@
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.fabricmc.smphack.Hacks.AntiHunger.AntiHunger;
import net.fabricmc.smphack.Hacks.AutoSprint.AutoSprint;
import net.fabricmc.smphack.Hacks.Autoclicker.Autoclicker;
import net.fabricmc.smphack.Hacks.CrystalAura.EndCrystalBreaker;
import net.fabricmc.smphack.Hacks.Fly.Fly;
import net.fabricmc.smphack.Hacks.Fly.Flymodes;
import net.fabricmc.smphack.Hacks.Jesus.Jesusm;
import net.fabricmc.smphack.Hacks.Jesus.jesus;
import net.fabricmc.smphack.Hacks.Killaura.KillAura;
import net.fabricmc.smphack.Hacks.NoWeather.NoWeather;
import net.fabricmc.smphack.Hacks.Nofall.Nofall;
import net.fabricmc.smphack.Hacks.Reach.Reach;
import net.fabricmc.smphack.Hacks.Speed.Speed;
import net.fabricmc.smphack.Hacks.SpeedMine.SpeedMine;
import net.fabricmc.smphack.Hacks.fullbright.Fullbright;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.lwjgl.glfw.GLFW;



// I know no one is gonna check the source code but for the few people who do and might need help, I am glad for you;
// This shit took me much time. I didnt know How the fuck do you even use keybinds and what onHudRender was. Heck I didnt even know what is the main class of fabric is. Bruh.
// This is not supposed to be a full on hack client
// Use this for fun with your friends and on shitty servers with shitty AntiCheat.

@Environment(EnvType.CLIENT)
public class HUDoverlay implements HudRenderCallback {

//new object from ___ class
Fly fly = new Fly();
Nofall noFall = new Nofall();
Jesusm jesus = new Jesusm();
Speed speed = new Speed();
jesus jes = new jesus();
Fullbright fullbright = new Fullbright();
SpeedMine speedmine= new SpeedMine();
NoWeather noWeather=new NoWeather();
public static jesus jes = new jesus();
Autoclicker autoclicker=new Autoclicker();
EndCrystalBreaker endCrystalBreaker = new EndCrystalBreaker();
KillAura killAura = new KillAura();
Reach reach= new Reach();
AutoSprint autoSprint = new AutoSprint();
AntiHunger antiHunger=new AntiHunger();
rendertext text = new rendertext();


float prevRainGradient;
int tw = 10;
int th = 10;
boolean Fullbright;
boolean NoWeather;

public static final KeyBinding FlyKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"Fly toggle",
InputUtil.Type.KEYSYM,
Expand Down Expand Up @@ -104,7 +95,15 @@ public class HUDoverlay implements HudRenderCallback {
"Imperials"
));

public static final KeyBinding AutoClickerKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"AutoClicker for autocrystal",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_UNKNOWN,
"Imperials"
));

MinecraftClient mc = MinecraftClient.getInstance();

@Override
public void onHudRender(MatrixStack matrices, float tickDelta) {
//To avoid stupid crashes
Expand All @@ -125,147 +124,27 @@ public void onHudRender(MatrixStack matrices, float tickDelta) {
TextRenderer font = mc.textRenderer;
ClientPlayerEntity player= MinecraftClient.getInstance().player;
if(font==null || player==null){return;}

int alpha = 127;
int blue = 0;

int color = (alpha << 24) | (0) | blue;

Screen.fill(matrices,5,76,20,76, color);


//To Check if Flykey is pressed
//Useless brackets in order to seperate the different mods
if (FlyKey.wasPressed()) {
fly.toggled();
}

//To get fly mode
Flymodes flymode = Flymodes.values()[fly.flybindcounter % Flymodes.values().length];
String flymodeText = flymode.name().toUpperCase();
Text text = Text.of("Fly [" + flymodeText + "]");

//To check if enabled or disabled
if (fly.enabled) {
fly.update();
flymode.fly();
//render [on]
font.draw(matrices, text, tw+2, th + 12, Formatting.GREEN.getColorValue());
} else {
//render [off]
font.draw(matrices, text, tw+2, th + 12, Formatting.RED.getColorValue());
//player.sendMessage(Text.of("Fly Off"));
}

//
{
if (Nofallkey.wasPressed()) {
noFall.toggled();
}
if (noFall.enabled) {
noFall.update();
//render [on]
font.draw(matrices, "Nofall", tw, th + 48, Formatting.GREEN.getColorValue());
} else {
//render [off]
font.draw(matrices, "Nofall", tw, th + 48, Formatting.RED.getColorValue());
//player.sendMessage(Text.of("Nofall Off"));
}
}
//
{
if(Jesuskey.wasPressed()) {
jesus.toggled();
}
if (jesus.enabled) {
jes.update();
font.draw(matrices, "Jesus", tw, th + 36, Formatting.GREEN.getColorValue());
} else {
font.draw(matrices, "Jesus", tw, th + 36, Formatting.RED.getColorValue());
}
}

if(SpeedKey.wasPressed())
{
speed.toggled();
}
if(speed.enabled)
{
speed.update();
font.draw(matrices, "Speed", tw+1, th + 24, Formatting.GREEN.getColorValue());
}
else
{
font.draw(matrices, "Speed", tw+1, th + 24, Formatting.RED.getColorValue());
assert mc.player != null;
mc.player.getAbilities().setWalkSpeed(speed.walkspeed);
}
Fullbright= GeneralConfig.getConfig().Fullbright;
if(Fullbright)
{fullbright.update();}
else
{mc.player.removeStatusEffect(StatusEffects.NIGHT_VISION);}

if (GeneralConfig.enabled)
{
font.draw(matrices, "Freecam", tw , th + 60, Formatting.GREEN.getColorValue());
}
if (!GeneralConfig.enabled)
{
font.draw(matrices, "Freecam", tw , th + 60, Formatting.RED.getColorValue());
}

speedmine.toggled();

NoWeather= GeneralConfig.getConfig().NoWeather;
if (NoWeather)
{
noWeather.update();
}
else
{
if(MinecraftClient.getInstance().world.isRaining()) {
MinecraftClient.getInstance().world.setRainGradient(0);
}
}

if (AutoCrystalBreakerKey.wasPressed())
{
endCrystalBreaker.toggled();
}
if (endCrystalBreaker.enabled) {
font.draw(matrices, "AutoCrystal", tw , th + 72, Formatting.GREEN.getColorValue());
}
else {
font.draw(matrices, "AutoCrystal", tw , th + 72, Formatting.RED.getColorValue());
}

if (KillauraKey.wasPressed())
{
killAura.toggled();
}
if (killAura.enabled) {
font.draw(matrices, "KillAura", tw , th + 84, Formatting.GREEN.getColorValue());
}
else {
font.draw(matrices, "KillAura", tw , th + 84, Formatting.RED.getColorValue());
}

if (ReachKey.wasPressed())
{
reach.toggled();
}
if (reach.enabled)
{
font.draw(matrices, "Reach", tw , th + 96, Formatting.GREEN.getColorValue());
}
else
{
font.draw(matrices, "Reach", tw , th + 96, Formatting.RED.getColorValue());
}


text.run();

text.renderFreecam(matrices,tw,th,font);
text.renderFlyMode(matrices,tw,th,font,fly);
text.renderJesus(matrices,tw,th,font,jes);
text.renderNofall(matrices,tw,th,font,noFall);
text.renderReach(matrices,tw,th,reach,font);
text.renderAutoCrystalBreaker(matrices,tw,th,font,endCrystalBreaker);
text.renderKillAura(matrices,tw,th,font,killAura);
text.renderSpeed(matrices,tw,th,font,speed);
text.renderAutoClicker(matrices,tw,th,font);


text.AutoSprint(autoSprint);
text.AntiHunger(antiHunger);
text.AutoClicker(autoclicker);
text.NoWeather();
text.Fullbright();
}
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package net.fabricmc.smphack.Hacks.AntiHunger;

import net.fabricmc.smphack.GeneralConfig;
import net.fabricmc.smphack.MainGui;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;

import java.util.Objects;

public class AntiHunger extends MainGui {

private MinecraftClient mc = MinecraftClient.getInstance();
private int sprintTick = 0;
private boolean isSprinting = false;
private int walkTick = 0;
private boolean isWalking = false;
boolean AntiHunger;

@Override
public void toggled()
{
AntiHunger= GeneralConfig.getConfig().getAntiHunger();
if (AntiHunger)
{
update();
}

}


@Override
public void update() {
if (mc.player == null) return;

// check if the player is sprinting
if (mc.options.forwardKey.isPressed() && !mc.player.isSprinting() && mc.player.getHungerManager().getFoodLevel() > 6) {
// send player start sprinting packet
sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
sprintTick = 0;
isSprinting = true;
} else if (mc.player.isSprinting()) {
sprintTick++;
if (sprintTick >= 10) {
// slow down hunger every 10 ticks while sprinting
mc.player.getHungerManager().addExhaustion(0.06f);
sprintTick = 0;
}
if (!mc.options.forwardKey.isPressed() || mc.player.getHungerManager().getFoodLevel() <= 6) {
// send player stop sprinting packet
sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
isSprinting = false;
}
}

// check if the player is walking
if ((mc.options.forwardKey.isPressed() || mc.options.leftKey.isPressed() || mc.options.rightKey.isPressed() || mc.options.backKey.isPressed())
&& !mc.player.isSprinting() && mc.player.getHungerManager().getFoodLevel() > 6) {
walkTick = 0;
isWalking = true;
} else if (isWalking) {
walkTick++;
if (walkTick >= 40) {
// slow down hunger every 40 ticks while walking
mc.player.getHungerManager().addExhaustion(0.06f);
walkTick = 0;
}
if (!mc.options.forwardKey.isPressed() && !mc.options.leftKey.isPressed() && !mc.options.rightKey.isPressed() && !mc.options.backKey.isPressed()
|| mc.player.getHungerManager().getFoodLevel() <= 6) {
isWalking = false;
}
}
}

private void sendPacket(Packet<?> packet) {
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(packet);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.fabricmc.smphack.Hacks.AutoSprint;

import net.fabricmc.smphack.GeneralConfig;
import net.fabricmc.smphack.MainGui;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;

public class AutoSprint extends MainGui {

MinecraftClient mc = MinecraftClient.getInstance();
boolean AutoSprint;


@Override
public void update() {
AutoSprint= GeneralConfig.getConfig().getAutoSprint();
assert mc.player != null;
Entity e = mc.player.getRootVehicle();
e.setSprinting(AutoSprint);
}
}
Loading

0 comments on commit ec185b3

Please sign in to comment.