Skip to content

Commit

Permalink
v2.4.0 NEW UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishisherewithhh committed Mar 3, 2023
1 parent 3a059a0 commit 4c2ba82
Show file tree
Hide file tree
Showing 52 changed files with 2,980 additions and 5 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
// Add repositories to retrieve artifacts from in here.
// 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
// for more information about repositories.
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 @@ -31,7 +35,7 @@ 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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ org.gradle.parallel=true
# check these on https://fabricmc.net/develop
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.1
loader_version=0.14.11
loader_version=0.14.13

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

Expand Down
57 changes: 57 additions & 0 deletions src/main/java/net/fabricmc/smphack/GeneralConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package net.fabricmc.smphack;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.smphack.Hacks.Freecam.CameraEntity;
import net.fabricmc.smphack.config.ConfigUtil;
import net.fabricmc.smphack.config.ControllersConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class GeneralConfig implements ModInitializer {

public static boolean enabled = false;
private static boolean spectator;
public static final KeyBinding FreecamKey = KeyBindingHelper.registerKeyBinding(new KeyBinding("Freecam toggle", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "Imperials"));


@Override
public void onInitialize() {

ConfigUtil.loadConfig();


ClientTickEvents.START_CLIENT_TICK.register(client -> {
while (FreecamKey.wasPressed()) {
toggleFreecam(client);

}
});
}

public static void toggleFreecam(MinecraftClient client) {
enabled = !enabled;
if (enabled) {
CameraEntity.createCamera(MinecraftClient.getInstance());
} else {
CameraEntity.removeCamera();
}

}

public static ControllersConfig getConfig() {
return ConfigUtil.getConfig();
}

public static boolean isEnabled() {
return enabled;
}

public static boolean isSpectator() {
return spectator;
}

}
230 changes: 230 additions & 0 deletions src/main/java/net/fabricmc/smphack/HUDoverlay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
package net.fabricmc.smphack;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
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.util.math.MatrixStack;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;



import static net.fabricmc.smphack.Keybinds.FlyKey;
import static net.fabricmc.smphack.Keybinds.ReachKey;
import static net.fabricmc.smphack.Keybinds.AutoCrystalBreakerKey;
import static net.fabricmc.smphack.Keybinds.KillauraKey;
import static net.fabricmc.smphack.Keybinds.Nofallkey;
import static net.fabricmc.smphack.Keybinds.SpeedKey;
import static net.fabricmc.smphack.Keybinds.Jesuskey;



// 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();
EndCrystalBreaker endCrystalBreaker = new EndCrystalBreaker();
KillAura killAura = new KillAura();
Reach reach= new Reach();
float prevRainGradient;
int tw = 10;
int th = 10;
boolean Fullbright;
boolean NoWeather;


MinecraftClient mc = MinecraftClient.getInstance();
@Override
public void onHudRender(MatrixStack matrices, float tickDelta) {
//To avoid stupid crashes
if (mc != null )
{
assert mc.player != null;
assert MinecraftClient.getInstance().world != null;
prevRainGradient = MinecraftClient.getInstance().world.getRainGradient(prevRainGradient);


//To stop rendering if debug screen or F3 menu is enabled
if (mc.options.debugEnabled) {return;}
//To avoid null crashes
if (Formatting.RED.getColorValue() == null || Formatting.BLUE.getColorValue() == null || Formatting.WHITE.getColorValue() == null || Formatting.GREEN.getColorValue() == null)
{
return;
}
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());
}


}
}
}

55 changes: 55 additions & 0 deletions src/main/java/net/fabricmc/smphack/Hacks/Criticals/Criticals.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package net.fabricmc.smphack.Hacks.Criticals;

import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.LivingEntity;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

public class Criticals {

MinecraftClient MC = MinecraftClient.getInstance();
public void onLeftClick()
{
if(MC.crosshairTarget == null
|| MC.crosshairTarget.getType() != HitResult.Type.ENTITY
|| !(((EntityHitResult)MC.crosshairTarget)
.getEntity() instanceof LivingEntity))
return;

doCritical();
}

public void doCritical()
{

assert MC.player != null;
// if(!MC.player.isOnGround())
// return;

if(MC.player.isTouchingWater() || MC.player.isInLava()){
return;}

doPacketJump();
}

private void doPacketJump()
{
assert MC.player != null;
double posX = MC.player.getX();
double posY = MC.player.getY();
double posZ = MC.player.getZ();

sendPos(posX, posY + 0.0625D, posZ, true);
sendPos(posX, posY, posZ, false);
sendPos(posX, posY + 1.1E-5D, posZ, false);
sendPos(posX, posY, posZ, false);
}

private void sendPos(double x, double y, double z, boolean onGround)
{
assert MC.player != null;
MC.player.networkHandler.sendPacket(
new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, onGround));
}
}
Loading

0 comments on commit 4c2ba82

Please sign in to comment.