Merge pull request #9 from RudideC/master

This commit is contained in:
Klesti Selimaj
2026-01-16 22:12:15 +01:00
committed by GitHub
17 changed files with 106 additions and 21 deletions
+6 -1
View File
@@ -1,5 +1,10 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx1G -XX:+UseParallelGC
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.7
@@ -13,10 +13,11 @@ public class ModManager {
new AutoSprint(),
new ArmorDisplay(),
new Fps(),
new PotionDisplay(),
new StatusEffects(),
new Coordinates(),
new Freelook(),
new Keystrokes()
new Keystrokes(),
new Fullbright()
};
public static void init() {
@@ -31,7 +32,7 @@ public class ModManager {
});
}
public static void updateEnabledModules() {
public static synchronized void updateEnabledModules() {
ENABLED_MODS.clear();
for (Module m : ALL_MODS) {
if (m.isEnabled()) {
@@ -24,7 +24,12 @@ public abstract class Module {
public abstract boolean isEnabled();
public abstract void setEnabled(boolean e);
public final void setEnabled(boolean e) {
onEnabled(e);
ModManager.updateEnabledModules();
}
public abstract void onEnabled(boolean e);
public final String getName() {
return details.name;
@@ -96,7 +96,7 @@ public class ArmorDisplay extends Module implements HudMod {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
}
@@ -24,8 +24,12 @@ public class AutoSprint extends Module {
if (SaturnClient.client.player == null || SaturnClient.client.getNetworkHandler() == null) {
return;
}
if (SaturnClient.client.options.forwardKey.isPressed() && !SaturnClient.client.options.backKey.isPressed() && !SaturnClient.client.player.isSneaking() &&
!SaturnClient.client.player.horizontalCollision) {
if (SaturnClient.client.options.forwardKey.isPressed()
&& !SaturnClient.client.options.backKey.isPressed()
&& !SaturnClient.client.player.isSneaking()
&& !SaturnClient.client.player.horizontalCollision
&& !SaturnClient.client.player.isUsingItem()) {
Objects.requireNonNull(SaturnClient.client.player).setSprinting(true);
}
}
@@ -36,7 +40,7 @@ public class AutoSprint extends Module {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
}
@@ -69,7 +69,7 @@ public class Coordinates extends Module implements HudMod {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
}
@@ -42,7 +42,7 @@ public class Crosshair extends Module {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
}
@@ -42,7 +42,7 @@ public class Fps extends Module implements HudMod {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
@@ -60,7 +60,7 @@ public class Freelook extends Module {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
@@ -0,0 +1,39 @@
package org.saturnclient.modules.mods;
import org.saturnclient.modules.Module;
import org.saturnclient.modules.ModuleDetails;
import org.saturnclient.saturnclient.config.Property;
public class Fullbright extends Module {
private static Property<Boolean> enabled = Property.bool(false);
private static Property<Integer> brightness = Property.integer(100);
public Fullbright() {
super(
new ModuleDetails("Fullbright", "fullbright")
.description("Allows you to see in the dark")
.tags("Camera")
.version("v0.1.0"),
enabled.named("Enabled"),
brightness.named("Brightness %"));
}
@Override
public boolean isEnabled() {
return enabled.value;
}
@Override
public void onEnabled(boolean e) {
enabled.value = e;
}
public static boolean shouldOverrideBrightness() {
return enabled.value;
}
public static float getBrightnessValue() {
return brightness.value / 10;
}
}
@@ -167,7 +167,7 @@ public class Keystrokes extends Module implements HudMod {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
dimensionsDirty = true;
}
@@ -20,7 +20,7 @@ import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
public class PotionDisplay extends Module implements HudMod {
public class StatusEffects extends Module implements HudMod {
public static Property<Boolean> enabled = Property.bool(false);
private static ModDimensions dimensions = new ModDimensions(60, 0);
@@ -30,9 +30,9 @@ public class PotionDisplay extends Module implements HudMod {
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("fire_resistance")).get(), 12000, 2),
};
public PotionDisplay() {
super(new ModuleDetails("Potion Display", "potion")
.description("Displays potion effects")
public StatusEffects() {
super(new ModuleDetails("Status effects", "effect")
.description("Displays status effects")
.version("v0.1.0")
.tags("Utility"),
@@ -99,7 +99,7 @@ public class PotionDisplay extends Module implements HudMod {
}
@Override
public void setEnabled(boolean e) {
public void onEnabled(boolean e) {
enabled.value = e;
}
}
@@ -0,0 +1,23 @@
// code modified from Gamma utils: https://github.com/Sjouwer/gamma-utils
package org.saturnclient.modules.mods.mixins;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.client.render.LightmapTextureManager;
import org.saturnclient.modules.mods.Fullbright;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(LightmapTextureManager.class)
public class LightmapTextureManagerMixin {
@ModifyExpressionValue(
method = "update",
at = @At(value = "INVOKE", target = "Ljava/lang/Math;max(FF)F", ordinal = 0)
)
private float modifyGamma(float original) {
if (Fullbright.shouldOverrideBrightness()) {
return Fullbright.getBrightnessValue();
}
return original;
}
}
@@ -15,6 +15,9 @@ public class Network {
static BufferedReader in;
static byte[] key = new byte[32];
private static final int CONNECTION_TIMEOUT = 5000;
private static final int READ_TIMEOUT = 5000;
public static class AES {
public static byte[] encryptAES256(String message, byte[] key) throws Exception {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
@@ -37,7 +40,11 @@ public class Network {
// Generate AES key
new SecureRandom().nextBytes(key);
socket = new Socket("77.247.92.168", 8080);
socket = new Socket();
socket.connect(new InetSocketAddress("77.247.92.168", 8080), CONNECTION_TIMEOUT);
socket.setSoTimeout(READ_TIMEOUT);
// out = new DataOutputStream(socket.getOutputStream());
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

+2 -1
View File
@@ -6,7 +6,8 @@
"client": [
"CameraMixin",
"EntityMixin",
"RenderMixin"
"RenderMixin",
"LightmapTextureManagerMixin"
],
"injectors": {
"defaultRequire": 1