Skip to content
Merged

Dev #31

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import works.alya.module.Module;
import works.alya.module.ModuleCategory;
import works.alya.module.impl.movement.flight.anarchy.AnarchyFlight;
import works.alya.module.impl.movement.flight.ncp.NCPFlight;
import works.alya.module.impl.movement.flight.vanilla.CreativeFlight;
import works.alya.module.impl.movement.flight.vanilla.NormalFlight;
Expand All @@ -37,7 +38,8 @@ public FlightModule() {
new VerusPacketFlight(this),
new VerusDamageFly(this),
new VerusGlideFly(this),
new NCPFlight(this)
new NCPFlight(this),
new AnarchyFlight(this)
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) Alya Client 2024-2025.
*
* This file belongs to Alya Client,
* an open-source Fabric injection client.
* Rye GitHub: https://github.com/AlyaClient/alya-beta.git
*
* THIS PROJECT DOES NOT HAVE A WARRANTY.
*
* Alya (and subsequently, its files) are all licensed under the MIT License.
* Alya should have come with a copy of the MIT License.
* If it did not, you may obtain a copy here:
* MIT License: https://opensource.org/license/mit
*
*/

package works.alya.module.impl.movement.flight.anarchy;

import works.alya.event.IEventListener;
import works.alya.event.impl.MotionEvent;
import works.alya.module.Module;
import works.alya.module.SubModule;

public class AnarchyFlight extends SubModule {
public AnarchyFlight(Module parent) {
super("Anarchy", parent);
}

@SuppressWarnings("unused")
private final IEventListener<MotionEvent> motionEvent = event -> {
if(!event.isPre()) return;
if(this.mc.player == null) return;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import works.alya.module.Module;
import works.alya.module.ModuleCategory;
import works.alya.module.impl.movement.flight.anarchy.AnarchyFlight;
import works.alya.module.impl.movement.speed.anarchy.AnarchySpeed;
import works.alya.module.impl.movement.speed.blocksmc.BlocksMCSpeed;
import works.alya.module.impl.movement.speed.ncp.NCPSpeed;
import works.alya.module.impl.movement.speed.normal.NormalSpeed;
Expand All @@ -38,7 +40,8 @@ public SpeedModule() {
new VerusSpeed(this),
new BlocksMCSpeed(this),
new SpartanSpeed(this),
new VulcanSpeed(this)
new VulcanSpeed(this),
new AnarchySpeed(this)
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) Alya Client 2024-2025.
*
* This file belongs to Alya Client,
* an open-source Fabric injection client.
* Rye GitHub: https://github.com/AlyaClient/alya-beta.git
*
* THIS PROJECT DOES NOT HAVE A WARRANTY.
*
* Alya (and subsequently, its files) are all licensed under the MIT License.
* Alya should have come with a copy of the MIT License.
* If it did not, you may obtain a copy here:
* MIT License: https://opensource.org/license/mit
*
*/

package works.alya.module.impl.movement.speed.anarchy;

import works.alya.event.IEventListener;
import works.alya.event.impl.MotionEvent;
import works.alya.module.Module;
import works.alya.module.SubModule;
import works.alya.utilities.player.MoveUtility;

public class AnarchySpeed extends SubModule {
private static int timeElapsed = 0;

public AnarchySpeed(Module parent) {
super("Anarchy", parent);
}

@SuppressWarnings("unused")
private final IEventListener<MotionEvent> motionEvent = event -> {
if(!event.isPre()) return;
if(this.mc.player == null) return;
timeElapsed++;

if(mc.player.isOnGround() && MoveUtility.isMoving()) {
mc.player.jump();
}

if(timeElapsed >= 10) {
MoveUtility.setSpeed(1f, true);
} else {
MoveUtility.setSpeed(0.28f, true);
}

if(timeElapsed > 11) {
timeElapsed = 0;
}
};

@Override
public void reset() {
super.reset();

timeElapsed = 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

package works.alya.module.impl.visual;

import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import works.alya.config.setting.impl.ModeSetting;
import works.alya.event.IEventListener;
import works.alya.event.impl.TickEvent;
import works.alya.module.Module;
import works.alya.module.ModuleCategory;

Expand All @@ -24,16 +29,62 @@ public class FullbrightModule extends Module {

public FullbrightModule() {
super("FullBright", "Full Bright", "Light mode for minecraft caves", ModuleCategory.VISUAL);

ModeSetting modeSetting = new ModeSetting("Mode", "Mode", "Gamma", "Gamma", "Potion");

addSetting(modeSetting);
}

// 1726, 104
@SuppressWarnings("unused")
private final IEventListener<TickEvent> tickEvent = event -> {
if(!isEnabled() || mc.player == null) return;

String mode = ((ModeSetting) getSetting("Mode")).getValue();
switch(mode) {
case "Gamma": {
mc.options.getGamma().setValue(1.0D);

break;
}

case "Potion": {
StatusEffectInstance effect = new StatusEffectInstance(
StatusEffects.NIGHT_VISION,
1000000000,
255,
false,
false
);
mc.player.addStatusEffect(effect);

break;
}
}
};

@Override
protected void onEnable() {
public void onEnable() {
previousGamma = mc.options.getGamma().getValue();
mc.options.getGamma().setValue(1.0D);
super.onEnable();
}

@Override
protected void onDisable() {
mc.options.getGamma().setValue(previousGamma);
if(mc.player == null) return;

String mode = ((ModeSetting) getSetting("Mode")).getValue();
switch(mode) {
case "Gamma": {
mc.options.getGamma().setValue(previousGamma);
break;
}
case "Potion": {
mc.player.removeStatusEffect(net.minecraft.entity.effect.StatusEffects.NIGHT_VISION);
break;
}
}

super.onDisable();
}
}
36 changes: 21 additions & 15 deletions src/client/java/works/alya/module/impl/world/NukerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package works.alya.module.impl.world;

import org.jetbrains.annotations.NotNull;
import works.alya.config.setting.impl.BooleanSetting;
import works.alya.config.setting.impl.ModeSetting;
import works.alya.config.setting.impl.NumberSetting;
Expand Down Expand Up @@ -237,21 +238,7 @@ public NukerModule() {
if(bedBreakingTicks >= 3) {
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));

Direction face = Direction.UP;
double relativeY = mc.player.getY() - currentBedBreaking.getY();
if(relativeY > 0.5) {
face = Direction.DOWN;
} else if(Math.abs(dx) > Math.abs(dz)) {
face = dx > 0 ? Direction.WEST : Direction.EAST;
} else {
face = dz > 0 ? Direction.NORTH : Direction.SOUTH;
}

PlayerActionC2SPacket stopBreaking = new PlayerActionC2SPacket(
PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK,
currentBedBreaking,
face
);
PlayerActionC2SPacket stopBreaking = getPlayerActionC2SPacket(dx, dz);
mc.getNetworkHandler().sendPacket(stopBreaking);

currentBedBreaking = null;
Expand Down Expand Up @@ -313,6 +300,25 @@ public NukerModule() {
}
};

private @NotNull PlayerActionC2SPacket getPlayerActionC2SPacket(double dx, double dz) {
Direction face = Direction.UP;
double relativeY = mc.player.getY() - currentBedBreaking.getY();
if(relativeY > 0.5) {
face = Direction.DOWN;
} else if(Math.abs(dx) > Math.abs(dz)) {
face = dx > 0 ? Direction.WEST : Direction.EAST;
} else {
face = dz > 0 ? Direction.NORTH : Direction.SOUTH;
}

PlayerActionC2SPacket stopBreaking = new PlayerActionC2SPacket(
PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK,
currentBedBreaking,
face
);
return stopBreaking;
}

private boolean isNotBedBlock(Block block) {
return block != Blocks.RED_BED && block != Blocks.BLACK_BED && block != Blocks.BLUE_BED
&& block != Blocks.BROWN_BED && block != Blocks.CYAN_BED && block != Blocks.GRAY_BED
Expand Down