summaryrefslogtreecommitdiff
path: root/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl')
-rw-r--r--src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Criticals.java5
-rw-r--r--src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Fullbright.java49
-rw-r--r--src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/HideModulesHUD.java12
-rw-r--r--src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java30
4 files changed, 58 insertions, 38 deletions
diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Criticals.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Criticals.java
index e539ee7..5c90cf0 100644
--- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Criticals.java
+++ b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Criticals.java
@@ -65,9 +65,8 @@ public class Criticals extends Module {
}
} else if (Objects.equals(mode.getMode(), "Bypass")) {
// don't do the sprint bypass and make it more random-looking to throw off anticheat
- sendYPacket(0.11);
- sendYPacket(0.1100013579);
- sendYPacket(0.0000013579);
+ sendYPacket(0.0625 + (Math.random() * 0.01));
+ sendYPacket(0.0);
}
}
}
diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Fullbright.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Fullbright.java
index bf72c6a..eefd5fb 100644
--- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Fullbright.java
+++ b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Fullbright.java
@@ -3,7 +3,6 @@ package net.justlearning.arslaan3102.arslaansmagichax.modules.impl;
import net.justlearning.arslaan3102.arslaansmagichax.modules.Category;
import net.justlearning.arslaan3102.arslaansmagichax.modules.Module;
import net.justlearning.arslaan3102.arslaansmagichax.modules.settings.ModeSetting;
-import net.minecraft.client.option.SimpleOption;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.registry.Registries;
@@ -11,23 +10,24 @@ import net.minecraft.registry.Registries;
import java.util.Objects;
public class Fullbright extends Module {
- private ModeSetting mode = new ModeSetting("Mode", "Gamma", "Effect", "Gamma", "Effect + Gamma");
- private SimpleOption<Double> option;
+ public ModeSetting mode = new ModeSetting("Mode", "Gamma", "Effect", "Gamma", "Effect + Gamma", "Break AO Renderer");
private double previousGamma = 1.0;
private boolean setPreviousGamma = false;
+ private String lastMode = ""; // track previous mode
public Fullbright() {
super("Fullbright", "Brightens up your world!", -1, Category.RENDER);
addSetting(mode);
+ lastMode = mode.getMode(); // initialize
}
@Override
protected void onEnable() {
if (mc.options == null) return;
- if (Objects.equals(mode.getMode(), "Gamma")) {
- if (!setPreviousGamma) previousGamma = mc.options.getGamma().getValue();
- setPreviousGamma = true;
- mc.options.getGamma().setValue(1000.0);
+ applyMode(mode.getMode());
+
+ if (mc.worldRenderer != null) {
+ mc.worldRenderer.reload();
}
}
@@ -35,31 +35,52 @@ public class Fullbright extends Module {
public void tick() {
if (!this.isEnabled() || mc.player == null) return;
- if (Objects.equals(mode.getMode(), "Effect")) {
- mc.options.getGamma().setValue(previousGamma);
- setPreviousGamma = false;
+ String currentMode = mode.getMode();
+ if (!Objects.equals(currentMode, lastMode)) {
+ applyMode(currentMode);
+
+ if (mc.worldRenderer != null) {
+ mc.worldRenderer.reload();
+ }
+
+ lastMode = currentMode;
+ }
+
+ if (Objects.equals(currentMode, "Effect")) {
+ mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()), 1, 255));
+ } else if (Objects.equals(currentMode, "Effect + Gamma")) {
mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()), 1, 255));
}
- if (Objects.equals(mode.getMode(), "Gamma")) {
+ }
+
+ private void applyMode(String modeName) {
+ if (Objects.equals(modeName, "Gamma")) {
if (!setPreviousGamma) previousGamma = mc.options.getGamma().getValue();
setPreviousGamma = true;
mc.options.getGamma().setValue(1000.0);
- }
- if (Objects.equals(mode.getMode(), "Effect + Gamma")) {
+ } else if (Objects.equals(modeName, "Effect + Gamma")) {
if (!setPreviousGamma) previousGamma = mc.options.getGamma().getValue();
setPreviousGamma = true;
mc.options.getGamma().setValue(1000.0);
- mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()), 1, 255));
+ } else if (Objects.equals(modeName, "Effect")) {
+ mc.options.getGamma().setValue(previousGamma);
+ setPreviousGamma = false;
}
}
@Override
protected void onDisable() {
if (mc.player == null) return;
+
if (mc.player.hasStatusEffect(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()))) {
mc.player.removeStatusEffect(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()));
}
mc.options.getGamma().setValue(previousGamma);
+
+ if (mc.worldRenderer != null) {
+ mc.worldRenderer.reload();
+ }
}
}
+
diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/HideModulesHUD.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/HideModulesHUD.java
new file mode 100644
index 0000000..09268e6
--- /dev/null
+++ b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/HideModulesHUD.java
@@ -0,0 +1,12 @@
+package net.justlearning.arslaan3102.arslaansmagichax.modules.impl;
+
+import net.justlearning.arslaan3102.arslaansmagichax.modules.Category;
+import net.justlearning.arslaan3102.arslaansmagichax.modules.Module;
+
+public class HideModulesHUD extends Module {
+ public HideModulesHUD() {
+ super("Hide Modules HUD", "Hides the list of modules in the top-left of the HUD.", -1, Category.RENDER);
+ }
+
+ // actual shit is in ModuleManager::onRenderHud (if condition to check if this is not enabled)
+}
diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java
index a57c855..71163b5 100644
--- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java
+++ b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java
@@ -2,24 +2,26 @@ package net.justlearning.arslaan3102.arslaansmagichax.modules.impl;
import net.justlearning.arslaan3102.arslaansmagichax.modules.Category;
import net.justlearning.arslaan3102.arslaansmagichax.modules.Module;
+import net.justlearning.arslaan3102.arslaansmagichax.modules.settings.ModeSetting;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.registry.Registries;
+import net.minecraft.text.Text;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
public class Xray extends Module {
private List<BlockState> interestingBlocks = new ArrayList<>();
- private double previousGamma = 1.0;
- private boolean setPreviousGamma = false;
public Xray() {
super("Xray", "Allows you to see through blocks.", -1, Category.RENDER);
+ // Add ores, spawners, liquids, etc.
interestingBlocks.add(Blocks.DIAMOND_ORE.getDefaultState());
interestingBlocks.add(Blocks.DEEPSLATE_DIAMOND_ORE.getDefaultState());
interestingBlocks.add(Blocks.GOLD_ORE.getDefaultState());
@@ -38,45 +40,31 @@ public class Xray extends Module {
interestingBlocks.add(Blocks.DEEPSLATE_COPPER_ORE.getDefaultState());
interestingBlocks.add(Blocks.NETHER_QUARTZ_ORE.getDefaultState());
interestingBlocks.add(Blocks.NETHER_GOLD_ORE.getDefaultState());
-
interestingBlocks.add(Blocks.SPAWNER.getDefaultState());
interestingBlocks.add(Blocks.CHEST.getDefaultState());
interestingBlocks.add(Blocks.ANCIENT_DEBRIS.getDefaultState());
interestingBlocks.add(Blocks.GLOWSTONE.getDefaultState());
-
interestingBlocks.add(Blocks.WATER.getDefaultState());
interestingBlocks.add(Blocks.LAVA.getDefaultState());
}
@Override
protected void onEnable() {
- if (mc.worldRenderer == null) return;
+ if (mc.worldRenderer != null) mc.worldRenderer.reload();
- mc.worldRenderer.reload();
+ if (mc.player != null) mc.player.sendMessage(Text.literal("[Xray] It is recommended to use this hack with Fullbright for a better experience."), false);
}
- @Override
- public void tick() {
- if (!this.isEnabled() || mc.player == null || mc.world == null || mc.options == null) return;
-
- if (!setPreviousGamma) previousGamma = mc.options.getGamma().getValue();
- setPreviousGamma = true;
- mc.options.getGamma().setValue(1000.0);
- mc.player.addStatusEffect(new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(StatusEffects.NIGHT_VISION.value()), 1, 255));
- }
@Override
protected void onDisable() {
- if (mc.worldRenderer == null || mc.options == null) return;
-
- mc.worldRenderer.reload();
- mc.options.getGamma().setValue(previousGamma);
- setPreviousGamma = false;
+ if (mc.worldRenderer != null) mc.worldRenderer.reload();
}
public boolean isInterestingBlock(BlockState state) {
return interestingBlocks.contains(state);
}
- // xraying is handled in BlockMixin
+ // xraying is handled in BlockMixin.java
}
+