all finished, now we fix bugs

This commit is contained in:
noil755 2019-11-29 23:47:25 -05:00
parent 7f560b58c2
commit bd1e1d5ca5
16 changed files with 155 additions and 144 deletions

View File

@ -61,7 +61,7 @@ public class Value<T> {
public int getEnum(String input) {
for (int i = 0; i < this.value.getClass().getEnumConstants().length; i++) {
final Enum e = (Enum) this.value.getClass().getEnumConstants()[i];
if (input.equalsIgnoreCase(e.name())) {
if (e.name().equalsIgnoreCase(input)) {
return i;
}
}

View File

@ -39,7 +39,7 @@ public final class ModuleCommand extends Command {
msg.appendSibling(new TextComponentString((mod.isEnabled() ? "\247a" : "\247c") + mod.getDisplayName() + "\2477" + ((i == size - 1) ? "" : ", "))
.setStyle(new Style()
.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("\2476" + (mod.getDesc() == null ? "There is no description for this module" : mod.getDesc()) + "\247f").appendSibling(new TextComponentString((mod.toUsageString() == null ? "" : "\n" + mod.toUsageString()) + "\247f"))))
.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, commandsModule.getPrefix().getString() + "toggle" + " " + mod.getDisplayName()))));
.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, commandsModule.getPrefix().getValue() + "toggle" + " " + mod.getDisplayName()))));
}
}

View File

@ -11,7 +11,7 @@ import me.rigamortis.seppuku.api.module.Module;
public final class ToggleCommand extends Command {
public ToggleCommand() {
super("Toggle", new String[]{"T", "Tog"}, "Allows you to toggle modules or between two mode options", "Toggle <Module>\nToggle <Module> <Mode> <Option> <Option>");
super("Toggle", new String[]{"T", "Tog"}, "Allows you to toggle modules or between two mode options", "Toggle <Module>");
}
@Override

View File

@ -6,9 +6,7 @@ import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.util.Timer;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@ -24,14 +22,18 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class ElytraFlyModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Vanilla", "Packet", "Bypass"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "Mode to use for elytra flight.", Mode.VANILLA);
public final NumberValue<Float> speed = new NumberValue<Float>("Speed", new String[]{"Spd"}, 1.0f, Float.class, 0.0f, 5.0f, 0.01f);
private enum Mode {
VANILLA, PACKET, BYPASS
}
public final BooleanValue autoStart = new BooleanValue("AutoStart", new String[]{"AutoStart", "start", "autojump"}, true);
public final BooleanValue disableInLiquid = new BooleanValue("DisableInLiquid", new String[]{"DisableInWater", "DisableInLava", "disableliquid", "liquidoff", "noliquid"}, true);
public final BooleanValue infiniteDurability = new BooleanValue("InfiniteDurability", new String[]{"InfiniteDura", "dura", "inf", "infdura"}, false);
public final BooleanValue noKick = new BooleanValue("NoKick", new String[]{"AntiKick", "Kick"}, true);
public final Value<Float> speed = new Value<Float>("Speed", new String[]{"Spd"}, "Speed multiplier for elytra flight, higher values equals more speed.", 1.0f, 0.0f, 5.0f, 0.01f);
public final Value<Boolean> autoStart = new Value<Boolean>("AutoStart", new String[]{"AutoStart", "start", "autojump"}, "Hold down the jump key to have an easy automated lift off.", true);
public final Value<Boolean> disableInLiquid = new Value<Boolean>("DisableInLiquid", new String[]{"DisableInWater", "DisableInLava", "disableliquid", "liquidoff", "noliquid"}, "Disables all elytra flight when the player is in contact wiht liquid.", true);
public final Value<Boolean> infiniteDurability = new Value<Boolean>("InfiniteDurability", new String[]{"InfiniteDura", "dura", "inf", "infdura"}, "Enables an old exploit that sends the start elytra-flying packet each tick.", false);
public final Value<Boolean> noKick = new Value<Boolean>("NoKick", new String[]{"AntiKick", "Kick"}, "Bypass the server kicking you for flying while in elytra flight (Only works for Packet mode!).", true);
private final Timer timer = new Timer();
@ -63,7 +65,7 @@ public final class ElytraFlyModule extends Module {
switch (event.getStage()) {
case PRE:
// liquid check
if (this.disableInLiquid.getBoolean() && (mc.player.isInWater() || mc.player.isInLava())) {
if (this.disableInLiquid.getValue() && (mc.player.isInWater() || mc.player.isInLava())) {
if (mc.player.isElytraFlying()) {
mc.getConnection().sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
}
@ -71,7 +73,7 @@ public final class ElytraFlyModule extends Module {
}
// automatic jump start
if (this.autoStart.getBoolean()) {
if (this.autoStart.getValue()) {
if (mc.gameSettings.keyBindJump.isKeyDown() && !mc.player.isElytraFlying()) { // jump is held, player is not elytra flying
if (mc.player.motionY < 0) { // player motion is falling
if (this.timer.passed(250)) { // 250 ms
@ -87,9 +89,9 @@ public final class ElytraFlyModule extends Module {
// ensure the player is in the elytra flying state
if (mc.player.isElytraFlying()) {
switch (mode.getInt()) {
case 0: // Vanilla
final float speedScaled = this.speed.getFloat() * 0.05f; // 5/100 of original value
switch (this.mode.getValue()) {
case VANILLA:
final float speedScaled = this.speed.getValue() * 0.05f; // 5/100 of original value
if (mc.gameSettings.keyBindJump.isKeyDown()) {
mc.player.motionY += speedScaled;
@ -109,18 +111,18 @@ public final class ElytraFlyModule extends Module {
mc.player.motionZ -= Math.cos(rotationYaw) * speedScaled;
}
break;
case 1: // Packet
case PACKET:
this.freezePlayer(mc.player);
this.runNoKick(mc.player);
final double[] directionSpeedPacket = MathUtil.directionSpeed(this.speed.getFloat());
final double[] directionSpeedPacket = MathUtil.directionSpeed(this.speed.getValue());
if (mc.player.movementInput.jump) {
mc.player.motionY = this.speed.getFloat();
mc.player.motionY = this.speed.getValue();
}
if (mc.player.movementInput.sneak) {
mc.player.motionY = -this.speed.getFloat();
mc.player.motionY = -this.speed.getValue();
}
if (mc.player.movementInput.moveStrafe != 0 || mc.player.movementInput.moveForward != 0) {
@ -131,7 +133,7 @@ public final class ElytraFlyModule extends Module {
mc.getConnection().sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
mc.getConnection().sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
break;
case 2: // Bypass / 9b9t
case BYPASS: // Bypass / 9b9t
if (mc.gameSettings.keyBindJump.isKeyDown()) {
mc.player.motionY = 0.02f;
}
@ -160,12 +162,12 @@ public final class ElytraFlyModule extends Module {
}
}
if (this.infiniteDurability.getBoolean()) {
if (this.infiniteDurability.getValue()) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
}
break;
case POST:
if (this.infiniteDurability.getBoolean()) {
if (this.infiniteDurability.getValue()) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
}
break;
@ -204,7 +206,7 @@ public final class ElytraFlyModule extends Module {
}
private void runNoKick(EntityPlayer player) {
if (this.noKick.getBoolean() && !player.isElytraFlying()) {
if (this.noKick.getValue() && !player.isElytraFlying()) {
if (player.ticksExisted % 4 == 0) {
player.motionY = -0.04f;
}

View File

@ -3,13 +3,10 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
import me.rigamortis.seppuku.api.event.network.EventSendPacket;
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.network.play.client.CPacketConfirmTeleport;
@ -27,11 +24,15 @@ import java.util.List;
*/
public final class FlightModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Vanilla", "Packet"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The flight mode to use.", Mode.VANILLA);
public final NumberValue speed = new NumberValue("Speed", new String[]{"Spd"}, 0.06f, Float.class, 0.0f, 10.0f, 0.01f);
private enum Mode {
VANILLA, PACKET
}
public final BooleanValue noKick = new BooleanValue("NoKick", new String[]{"AntiKick", "Kick"}, true);
public final Value<Float> speed = new Value<Float>("Speed", new String[]{"Spd"}, "Speed multiplier for flight, higher values equals more speed.", 1.0f, 0.0f, 5.0f, 0.01f);
public final Value<Boolean> noKick = new Value<Boolean>("NoKick", new String[]{"AntiKick", "Kick"}, "Bypass the server kicking you for flying while in flight.", true);
private int teleportId;
private List<CPacketPlayer> packets = new ArrayList<>();
@ -43,7 +44,7 @@ public final class FlightModule extends Module {
@Override
public void onEnable() {
super.onEnable();
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.PACKET) {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.world != null) {
@ -63,14 +64,7 @@ public final class FlightModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
}
@Listener
public void onUpdate(EventPlayerUpdate event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
}
return this.mode.getValue().name();
}
@Listener
@ -78,18 +72,18 @@ public final class FlightModule extends Module {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
if (this.mode.getInt() == 0) {
if (this.mode.getValue() == Mode.VANILLA) {
mc.player.setVelocity(0, 0, 0);
mc.player.jumpMovementFactor = speed.getFloat();
mc.player.jumpMovementFactor = this.speed.getValue();
if (this.noKick.getBoolean()) {
if (this.noKick.getValue()) {
if (mc.player.ticksExisted % 4 == 0) {
mc.player.motionY = -0.04f;
}
}
final double[] dir = MathUtil.directionSpeed(speed.getFloat());
final double[] dir = MathUtil.directionSpeed(this.speed.getValue());
if (mc.player.movementInput.moveStrafe != 0 || mc.player.movementInput.moveForward != 0) {
mc.player.motionX = dir[0];
@ -100,19 +94,19 @@ public final class FlightModule extends Module {
}
if (mc.gameSettings.keyBindJump.isKeyDown()) {
if (this.noKick.getBoolean()) {
mc.player.motionY = mc.player.ticksExisted % 20 == 0 ? -0.04f : speed.getFloat();
if (this.noKick.getValue()) {
mc.player.motionY = mc.player.ticksExisted % 20 == 0 ? -0.04f : this.speed.getValue();
} else {
mc.player.motionY += speed.getFloat();
mc.player.motionY += this.speed.getValue();
}
}
if (mc.gameSettings.keyBindSneak.isKeyDown()) {
mc.player.motionY -= speed.getFloat();
mc.player.motionY -= this.speed.getValue();
}
}
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.PACKET) {
if (this.teleportId <= 0) {
final CPacketPlayer bounds = new CPacketPlayer.Position(Minecraft.getMinecraft().player.posX, 0, Minecraft.getMinecraft().player.posZ, Minecraft.getMinecraft().player.onGround);
this.packets.add(bounds);
@ -127,7 +121,7 @@ public final class FlightModule extends Module {
if (mc.gameSettings.keyBindJump.isKeyDown()) {
if (this.noKick.getBoolean()) {
if (this.noKick.getValue()) {
ySpeed = mc.player.ticksExisted % 20 == 0 ? -0.04f : 0.062f;
} else {
ySpeed = 0.062f;
@ -135,10 +129,10 @@ public final class FlightModule extends Module {
} else if (mc.gameSettings.keyBindSneak.isKeyDown()) {
ySpeed = -0.062d;
} else {
ySpeed = mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().expand(-0.0625d, -0.0625d, -0.0625d)).isEmpty() ? (mc.player.ticksExisted % 4 == 0) ? (this.noKick.getBoolean() ? -0.04f : 0.0f) : 0.0f : 0.0f;
ySpeed = mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().expand(-0.0625d, -0.0625d, -0.0625d)).isEmpty() ? (mc.player.ticksExisted % 4 == 0) ? (this.noKick.getValue() ? -0.04f : 0.0f) : 0.0f : 0.0f;
}
final double[] directionalSpeed = MathUtil.directionSpeed(this.speed.getFloat());
final double[] directionalSpeed = MathUtil.directionSpeed(this.speed.getValue());
if (mc.gameSettings.keyBindJump.isKeyDown() || mc.gameSettings.keyBindSneak.isKeyDown() || mc.gameSettings.keyBindForward.isKeyDown() || mc.gameSettings.keyBindBack.isKeyDown() || mc.gameSettings.keyBindRight.isKeyDown() || mc.gameSettings.keyBindLeft.isKeyDown()) {
if (directionalSpeed[0] != 0.0d || ySpeed != 0.0d || directionalSpeed[1] != 0.0d) {
@ -166,7 +160,7 @@ public final class FlightModule extends Module {
}
}
} else {
if (this.noKick.getBoolean()) {
if (this.noKick.getValue()) {
if (mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().expand(-0.0625d, -0.0625d, -0.0625d)).isEmpty()) {
mc.player.setVelocity(0, (mc.player.ticksExisted % 2 == 0) ? 0.04f : -0.04f, 0);
move(0, (mc.player.ticksExisted % 2 == 0) ? 0.04f : -0.04f, 0);
@ -197,7 +191,7 @@ public final class FlightModule extends Module {
@Listener
public void sendPacket(EventSendPacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.PACKET) {
if (event.getPacket() instanceof CPacketPlayer && !(event.getPacket() instanceof CPacketPlayer.Position)) {
event.setCanceled(true);
}
@ -216,7 +210,7 @@ public final class FlightModule extends Module {
@Listener
public void recievePacket(EventReceivePacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.PACKET) {
if (event.getPacket() instanceof SPacketPlayerPosLook) {
final SPacketPlayerPosLook packet = (SPacketPlayerPosLook) event.getPacket();
if (Minecraft.getMinecraft().player.isEntityAlive() && Minecraft.getMinecraft().world.isBlockLoaded(new BlockPos(Minecraft.getMinecraft().player.posX, Minecraft.getMinecraft().player.posY, Minecraft.getMinecraft().player.posZ)) && !(Minecraft.getMinecraft().currentScreen instanceof GuiDownloadTerrain)) {

View File

@ -5,8 +5,7 @@ import me.rigamortis.seppuku.api.event.network.EventSendPacket;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.event.world.EventLiquidCollisionBB;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockLiquid;
@ -24,9 +23,13 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class JesusModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Vanilla", "NCP", "Bounce"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The current Jesus/WaterWalk mode to use.", Mode.NCP);
public final NumberValue offset = new NumberValue("Offset", new String[]{"Off", "O"}, 0.05f, Float.class, 0.0f, 0.9f, 0.01f);
private enum Mode {
VANILLA, NCP, BOUNCE
}
public final Value<Float> offset = new Value<Float>("Offset", new String[]{"Off", "O"}, "Amount to offset the player into the water's bounding box.", 0.05f, 0.0f, 0.9f, 0.01f);
public JesusModule() {
super("Jesus", new String[]{"LiquidWalk", "WaterWalk"}, "Allows you to walk on water", "NONE", -1, ModuleType.MOVEMENT);
@ -34,17 +37,17 @@ public final class JesusModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
public void getLiquidCollisionBB(EventLiquidCollisionBB event) {
if(Minecraft.getMinecraft().world != null && Minecraft.getMinecraft().player != null) {
if (this.checkCollide() && !(Minecraft.getMinecraft().player.motionY >= 0.1f) && event.getBlockPos().getY() < Minecraft.getMinecraft().player.posY - this.offset.getFloat()) {
if (this.checkCollide() && !(Minecraft.getMinecraft().player.motionY >= 0.1f) && event.getBlockPos().getY() < Minecraft.getMinecraft().player.posY - this.offset.getValue()) {
if (Minecraft.getMinecraft().player.getRidingEntity() != null) {
event.setBoundingBox(new AxisAlignedBB(0, 0, 0, 1, 1 - this.offset.getFloat(), 1));
event.setBoundingBox(new AxisAlignedBB(0, 0, 0, 1, 1 - this.offset.getValue(), 1));
} else {
if (this.mode.getInt() == 2) {
if (this.mode.getValue() == Mode.BOUNCE) {
event.setBoundingBox(new AxisAlignedBB(0, 0, 0, 1, 0.9f, 1));
} else {
event.setBoundingBox(Block.FULL_BLOCK_AABB);
@ -68,11 +71,11 @@ public final class JesusModule extends Module {
public void sendPacket(EventSendPacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (event.getPacket() instanceof CPacketPlayer) {
if (this.mode.getInt() != 0 && Minecraft.getMinecraft().player.getRidingEntity() == null && !Minecraft.getMinecraft().gameSettings.keyBindJump.isKeyDown()) {
if (this.mode.getValue() != Mode.VANILLA && Minecraft.getMinecraft().player.getRidingEntity() == null && !Minecraft.getMinecraft().gameSettings.keyBindJump.isKeyDown()) {
final CPacketPlayer packet = (CPacketPlayer) event.getPacket();
if (!isInLiquid() && isOnLiquid(this.offset.getFloat()) && checkCollide() && Minecraft.getMinecraft().player.ticksExisted % 3 == 0) {
packet.y -= this.offset.getFloat();
if (!isInLiquid() && isOnLiquid(this.offset.getValue()) && checkCollide() && Minecraft.getMinecraft().player.ticksExisted % 3 == 0) {
packet.y -= this.offset.getValue();
}
}
}

View File

@ -7,7 +7,7 @@ import me.rigamortis.seppuku.api.event.world.EventCollideSoulSand;
import me.rigamortis.seppuku.api.event.world.EventLandOnSlime;
import me.rigamortis.seppuku.api.event.world.EventWalkOnSlime;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemShield;
@ -21,11 +21,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class NoSlowDownModule extends Module {
public final BooleanValue soulsand = new BooleanValue("SoulSand", new String[]{"Soul", "SS"}, true);
public final BooleanValue slime = new BooleanValue("Slime", new String[]{"Slime", "SlimeBlock", "SlimeBlocks", "slim"}, true);
public final BooleanValue items = new BooleanValue("Items", new String[]{"it"}, true);
public final BooleanValue cobweb = new BooleanValue("CobWeb", new String[]{"Webs", "Cob"}, true);
public final BooleanValue ice = new BooleanValue("Ice", new String[]{"ic"}, true);
public final Value<Boolean> soulsand = new Value<Boolean>("SoulSand", new String[]{"Soul", "SS"}, "Disables the slowness from walking on soul sand.", true);
public final Value<Boolean> slime = new Value<Boolean>("Slime", new String[]{"Slime", "SlimeBlock", "SlimeBlocks", "slim"}, "Disables the slowness from walking on slime blocks.", true);
public final Value<Boolean> items = new Value<Boolean>("Items", new String[]{"it"}, "Disables the slowness from using items (shields, eating, etc).", true);
public final Value<Boolean> cobweb = new Value<Boolean>("CobWeb", new String[]{"Webs", "Cob"}, "Disables slowness from moving in a cobweb.", true);
public final Value<Boolean> ice = new Value<Boolean>("Ice", new String[]{"ic"}, "Disables slowness from walking on ice.", true);
public NoSlowDownModule() {
super("NoSlow", new String[]{"AntiSlow", "NoSlowdown", "AntiSlowdown"}, "Allows you to move faster with things that slow you down", "NONE", -1, ModuleType.MOVEMENT);
@ -41,21 +41,21 @@ public final class NoSlowDownModule extends Module {
@Listener
public void collideSoulSand(EventCollideSoulSand event) {
if (this.soulsand.getBoolean()) {
if (this.soulsand.getValue()) {
event.setCanceled(true);
}
}
@Listener
public void onWalkOnSlime(EventWalkOnSlime event) {
if (this.slime.getBoolean()) {
if (this.slime.getValue()) {
event.setCanceled(true);
}
}
@Listener
public void onLandOnSlime(EventLandOnSlime event) {
if (this.slime.getBoolean()) {
if (this.slime.getValue()) {
event.setCanceled(true);
}
}
@ -67,20 +67,20 @@ public final class NoSlowDownModule extends Module {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.player.isHandActive()) {
if(mc.player.getHeldItem(mc.player.getActiveHand()).getItem() instanceof ItemShield) {
if(mc.player.movementInput.moveStrafe != 0 || mc.player.movementInput.moveForward != 0 && mc.player.getItemInUseMaxCount() >= 8) {
if (mc.player.getHeldItem(mc.player.getActiveHand()).getItem() instanceof ItemShield) {
if (mc.player.movementInput.moveStrafe != 0 || mc.player.movementInput.moveForward != 0 && mc.player.getItemInUseMaxCount() >= 8) {
mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing()));
}
}
}
if (this.cobweb.getBoolean()) {
if (this.cobweb.getValue()) {
mc.player.isInWeb = false;
if (mc.player.getRidingEntity() != null) {
mc.player.getRidingEntity().isInWeb = false;
}
}
if (this.ice.getBoolean()) {
if (this.ice.getValue()) {
if (mc.player.getRidingEntity() != null) {
Blocks.ICE.setDefaultSlipperiness(0.98f);
Blocks.FROSTED_ICE.setDefaultSlipperiness(0.98f);
@ -96,7 +96,7 @@ public final class NoSlowDownModule extends Module {
@Listener
public void updateInput(EventUpdateInput event) {
if (this.items.getBoolean()) {
if (this.items.getValue()) {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.player.isHandActive() && !mc.player.isRiding()) {
mc.player.movementInput.moveStrafe /= 0.2f;

View File

@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
@ -15,10 +15,10 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class NoVoidModule extends Module {
public final NumberValue height = new NumberValue("Height", new String[]{"hgt"}, 16, Integer.class, 0, 256, 1);
public final Value<Integer> height = new Value<Integer>("Height", new String[]{"hgt"}, "The Y level the player must be at or below to start running ray-traces for void checks.", 16, 0, 256, 1);
public NoVoidModule() {
super("NoVoid", new String[] {"AntiVoid"}, "Slows down movement when over the void", "NONE", -1, ModuleType.MOVEMENT);
super("NoVoid", new String[]{"AntiVoid"}, "Slows down movement when over the void.", "NONE", -1, ModuleType.MOVEMENT);
}
@Listener
@ -26,7 +26,7 @@ public final class NoVoidModule extends Module {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
if(!mc.player.noClip) {
if(mc.player.posY <= this.height.getInt()) {
if (mc.player.posY <= this.height.getValue()) {
final RayTraceResult trace = mc.world.rayTraceBlocks(mc.player.getPositionVector(), new Vec3d(mc.player.posX, 0, mc.player.posZ), false, false, false);

View File

@ -3,8 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.AxisAlignedBB;
@ -24,10 +23,10 @@ import java.util.List;
public class PullDownModule extends Module {
private final List<RayTraceResult> rayTraceResults = new ArrayList<>(8);
private static final float VELOCITY_MAX = 10.0f;
public final BooleanValue jumpDisables =
new BooleanValue("JumpDisables", new String[]{"jump"}, true);
public final NumberValue<Float> speed =
new NumberValue<>("Speed", new String[]{"velocity"}, 4.0f, Float.class,
public final Value<Boolean> jumpDisables =
new Value<Boolean>("JumpDisables", new String[]{"jump"}, "When enabled, holding the jump key will disable any pulldown events from triggering.", true);
public final Value<Float> speed =
new Value<Float>("Speed", new String[]{"velocity"}, "Speed multiplier at which the player will be pulled down at.", 4.0f,
0f, VELOCITY_MAX, 1f);
public PullDownModule() {
@ -39,7 +38,7 @@ public class PullDownModule extends Module {
public void onUpdate(EventPlayerUpdate event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
if (jumpDisables.getBoolean() && mc.gameSettings.keyBindJump.isKeyDown())
if (this.jumpDisables.getValue() && mc.gameSettings.keyBindJump.isKeyDown())
return;
if (mc.player.isElytraFlying() || mc.player.capabilities.isFlying ||
@ -51,7 +50,7 @@ public class PullDownModule extends Module {
.subtract(0.0d, 3.0d, 0.0d)).stream()
.anyMatch(this::hitsCollidableBlock);
if (!doesPlayerCollide)
mc.player.motionY = -speed.getFloat();
mc.player.motionY = -this.speed.getValue();
}
}

View File

@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.event.player.EventMove;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.Value;
import me.rigamortis.seppuku.impl.module.player.FreeCamModule;
import net.minecraft.client.Minecraft;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
@ -14,7 +14,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class SafeWalkModule extends Module {
public final NumberValue height = new NumberValue("Height", new String[]{"Hei", "H"}, 1, Integer.class, 0, 32, 1);
public final Value<Integer> height = new Value<Integer>("Height", new String[]{"Hei", "H"}, "The distance from the player on the Y-axis to run safe-walk checks for.", 1, 0, 32, 1);
public SafeWalkModule() {
super("SafeWalk", new String[]{"SWalk"}, "Prevents you from walking off certain blocks", "NONE", -1, ModuleType.MOVEMENT);
@ -27,15 +27,15 @@ public final class SafeWalkModule extends Module {
double y = event.getY();
double z = event.getZ();
final FreeCamModule freeCam = (FreeCamModule)Seppuku.INSTANCE.getModuleManager().find(FreeCamModule.class);
final FreeCamModule freeCam = (FreeCamModule) Seppuku.INSTANCE.getModuleManager().find(FreeCamModule.class);
if(freeCam != null && freeCam.isEnabled()) {
if (freeCam != null && freeCam.isEnabled()) {
return;
}
if (mc.player.onGround && !mc.player.noClip) {
double increment;
for (increment = 0.05D; x != 0.0D && isOffsetBBEmpty(x, -this.height.getInt(), 0.0D); ) {
for (increment = 0.05D; x != 0.0D && isOffsetBBEmpty(x, -this.height.getValue(), 0.0D); ) {
if (x < increment && x >= -increment) {
x = 0.0D;
} else if (x > 0.0D) {
@ -44,7 +44,7 @@ public final class SafeWalkModule extends Module {
x += increment;
}
}
for (; z != 0.0D && isOffsetBBEmpty(0.0D, -this.height.getInt(), z); ) {
for (; z != 0.0D && isOffsetBBEmpty(0.0D, -this.height.getValue(), z); ) {
if (z < increment && z >= -increment) {
z = 0.0D;
} else if (z > 0.0D) {
@ -53,7 +53,7 @@ public final class SafeWalkModule extends Module {
z += increment;
}
}
for (; x != 0.0D && z != 0.0D && isOffsetBBEmpty(x, -this.height.getInt(), z); ) {
for (; x != 0.0D && z != 0.0D && isOffsetBBEmpty(x, -this.height.getValue(), z); ) {
if (x < increment && x >= -increment) {
x = 0.0D;
} else if (x > 0.0D) {

View File

@ -4,7 +4,7 @@ import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.state.IBlockState;
@ -32,16 +32,15 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public final class ScaffoldModule extends Module {
public final BooleanValue refill = new BooleanValue("Refill", new String[]{"ref"}, true);
public final BooleanValue destroy = new BooleanValue("Destroy", new String[]{"Dest"}, false);
public final Value<Boolean> refill = new Value<Boolean>("Refill", new String[]{"ref"}, "If the held item is empty or not a block, fill the slot with a block from the inventory when the scaffold is triggered to place.", true);
public final Value<Boolean> destroy = new Value<Boolean>("Destroy", new String[]{"Dest"}, "When enabled, after placing the block, forces the player to swing/destroy at the same position.", false);
private int[] blackList = new int[]{145, 130, 12, 252, 54, 146, 122, 13, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 50};
private List<BlockPos> blocks = new CopyOnWriteArrayList<BlockPos>();
public ScaffoldModule() {
super("Scaffold", new String[]{"Scaff"}, "Automatically places blocks where you are walking", "NONE", -1, ModuleType.MOVEMENT);
super("Scaffold", new String[]{"Scaff"}, "Automatically places blocks where you are walking.", "NONE", -1, ModuleType.MOVEMENT);
}
@Override
@ -64,8 +63,7 @@ public final class ScaffoldModule extends Module {
return;
}
if (this.destroy.getBoolean()) {
if (this.destroy.getValue()) {
double maxDist = 4.5f;
BlockPos closest = null;
@ -95,14 +93,14 @@ public final class ScaffoldModule extends Module {
final BlockPos pos = new BlockPos(block.x, block.y, block.z);
this.placeBlock(pos);
if (this.destroy.getBoolean() && this.canBreak(pos)) {
if (this.destroy.getValue() && this.canBreak(pos)) {
this.blocks.add(pos);
}
}
} else {
final Vec3d block = getFirstBlock(dir);
if (this.refill.getBoolean() && block != null) {
if (this.refill.getValue() && block != null) {
final int slot = this.findStackHotbar();
if (slot != -1) {
mc.player.inventory.currentItem = slot;

View File

@ -4,7 +4,7 @@ import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.network.EventSendPacket;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.network.play.client.CPacketEntityAction;
@ -17,7 +17,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class SneakModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Vanilla", "NCP"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The sneak mode to use.", Mode.VANILLA);
private enum Mode {
VANILLA, NCP
}
public SneakModule() {
super("Sneak", new String[]{"Sneek"}, "Allows you to sneak at full speed", "NONE", -1, ModuleType.MOVEMENT);
@ -33,20 +37,20 @@ public final class SneakModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
public void onWalkingUpdate(EventUpdateWalkingPlayer event) {
final Minecraft mc = Minecraft.getMinecraft();
if (event.getStage() == EventStageable.EventStage.PRE) {
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case VANILLA:
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SNEAKING));
break;
case 1:
case NCP:
if (!mc.player.isSneaking()) {
if (isMoving()) {
if (this.isMoving()) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SNEAKING));
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SNEAKING));
} else {
@ -56,8 +60,8 @@ public final class SneakModule extends Module {
break;
}
} else {
if (this.mode.getInt() == 1) {
if (isMoving()) {
if (this.mode.getValue() == Mode.NCP) {
if (this.isMoving()) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SNEAKING));
}
}

View File

@ -6,8 +6,7 @@ import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.util.MathUtil;
import me.rigamortis.seppuku.api.value.old.NumberValue;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.init.MobEffects;
@ -19,16 +18,20 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class SpeedModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Vanilla", "Bhop"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The speed mode to use.", Mode.VANILLA);
public final NumberValue speed = new NumberValue("Speed", new String[]{"Spd"}, 0.1f, Float.class, 0.0f, 10.0f, 0.1f);
private enum Mode {
VANILLA, BHOP
}
public final Value<Float> speed = new Value<Float>("Speed", new String[]{"Spd"}, "Speed multiplier, higher numbers equal faster motion.", 0.1f, 0.0f, 10.0f, 0.1f);
private int tick;
private double prevDistance;
private double movementSpeed;
public SpeedModule() {
super("Speed", new String[]{"Spd"}, "Allows you to move faster", "NONE", -1, ModuleType.MOVEMENT);
super("Speed", new String[]{"Spd"}, "Allows you to move faster.", "NONE", -1, ModuleType.MOVEMENT);
}
@Override
@ -52,7 +55,7 @@ public final class SpeedModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
private double getDefaultSpeed() {
@ -74,7 +77,7 @@ public final class SpeedModule extends Module {
@Listener
public void onMove(EventMove event) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.BHOP) {
final Minecraft mc = Minecraft.getMinecraft();
if (MathUtil.round(mc.player.posY - (int) mc.player.posY, 3) == MathUtil.round(0.138D, 3)) {
@ -110,7 +113,7 @@ public final class SpeedModule extends Module {
@Listener
public void onWalkingUpdate(EventUpdateWalkingPlayer event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (this.mode.getInt() == 1) {
if (this.mode.getValue() == Mode.BHOP) {
final Minecraft mc = Minecraft.getMinecraft();
final double deltaX = (mc.player.posX - mc.player.prevPosX);
final double deltaZ = (mc.player.posZ - mc.player.prevPosZ);
@ -127,7 +130,7 @@ public final class SpeedModule extends Module {
final Entity riding = mc.player.getRidingEntity();
if (riding != null) {
final double[] dir = MathUtil.directionSpeed(speed.getFloat());
final double[] dir = MathUtil.directionSpeed(this.speed.getValue());
if (mc.player.movementInput.moveStrafe != 0 || mc.player.movementInput.moveForward != 0) {
riding.motionX = dir[0];

View File

@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
@ -13,7 +13,11 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class SprintModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"Rage", "Legit"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The sprint mode to use.", Mode.RAGE);
private enum Mode {
RAGE, LEGIT
}
public SprintModule() {
super("Sprint", new String[]{"AutoSprint", "Spr"}, "Automatically sprints for you", "NONE", -1, ModuleType.MOVEMENT);
@ -30,7 +34,7 @@ public final class SprintModule extends Module {
@Override
public String getMetaData() {
return this.mode.getSelectedOption();
return this.mode.getValue().name();
}
@Listener
@ -38,13 +42,13 @@ public final class SprintModule extends Module {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case RAGE:
if ((mc.gameSettings.keyBindForward.isKeyDown() || mc.gameSettings.keyBindBack.isKeyDown() || mc.gameSettings.keyBindLeft.isKeyDown() || mc.gameSettings.keyBindRight.isKeyDown()) && !(mc.player.isSneaking()) && !(mc.player.collidedHorizontally) && !(mc.player.getFoodStats().getFoodLevel() <= 6f)) {
mc.player.setSprinting(true);
}
break;
case 1:
case LEGIT:
if ((mc.gameSettings.keyBindForward.isKeyDown()) && !(mc.player.isSneaking()) && !(mc.player.isHandActive()) && !(mc.player.collidedHorizontally) && mc.currentScreen == null && !(mc.player.getFoodStats().getFoodLevel() <= 6f)) {
mc.player.setSprinting(true);
}

View File

@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.OptionalValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.material.Material;
@ -21,11 +21,15 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class StepModule extends Module {
public final OptionalValue mode = new OptionalValue("Mode", new String[]{"Mode", "M"}, 0, new String[]{"One", "Two"});
public final Value<Mode> mode = new Value<Mode>("Mode", new String[]{"Mode", "M"}, "The step block-height mode to use.", Mode.ONE);
private final double[] oneblockPositions = { 0.42D, 0.75D };
private enum Mode {
ONE, TWO
}
private final double[] twoblockPositions = { 0.4D, 0.75D, 0.5D, 0.41D, 0.83D, 1.16D, 1.41D, 1.57D, 1.58D, 1.42D };
private final double[] oneblockPositions = {0.42D, 0.75D};
private final double[] twoblockPositions = {0.4D, 0.75D, 0.5D, 0.41D, 0.83D, 1.16D, 1.41D, 1.57D, 1.58D, 1.42D};
private double[] selectedPositions = new double[0];
@ -45,11 +49,11 @@ public final class StepModule extends Module {
if (event.getStage() == EventStageable.EventStage.PRE) {
final Minecraft mc = Minecraft.getMinecraft();
switch (this.mode.getInt()) {
case 0:
switch (this.mode.getValue()) {
case ONE:
this.selectedPositions = this.oneblockPositions;
break;
case 1:
case TWO:
this.selectedPositions = this.twoblockPositions;
break;
}
@ -64,7 +68,7 @@ public final class StepModule extends Module {
for (int x = MathHelper.floor(bb.minX); x < MathHelper.floor(bb.maxX + 1.0D); x++) {
for (int z = MathHelper.floor(bb.minZ); z < MathHelper.floor(bb.maxZ + 1.0D); z++) {
final Block block = mc.world.getBlockState(new BlockPos(x, bb.maxY + 1, z)).getBlock();
if(!(block instanceof BlockAir)) {
if (!(block instanceof BlockAir)) {
return;
}
}

View File

@ -3,7 +3,7 @@ package me.rigamortis.seppuku.impl.module.movement;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.event.player.EventMove;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.old.BooleanValue;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.init.MobEffects;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
@ -13,7 +13,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class StrafeModule extends Module {
public BooleanValue ground = new BooleanValue("Ground", new String[]{"Ground", "OnGround"}, false);
public Value<Boolean> ground = new Value<Boolean>("Ground", new String[]{"Ground", "OnGround"}, "When enabled, enables strafe movement while on ground.", false);
public StrafeModule() {
super("Strafe", new String[]{"Strafe"}, "Unlocks full movement control while airborne, and optionally on ground too.", "NONE", -1, ModuleType.MOVEMENT);
@ -30,7 +30,7 @@ public final class StrafeModule extends Module {
return;
// check to bypass option on ground or not
if (!this.ground.getBoolean()) {
if (!this.ground.getValue()) {
if (mc.player.onGround)
return;
}