| 1 | /*
|
| 2 | * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
|
| 3 | * Copyright (c) Meteor Development.
|
| 4 | */
|
| 5 |
|
| 6 | package meteordevelopment.meteorclient.systems.modules.movement;
|
| 7 |
|
| 8 | import meteordevelopment.meteorclient.events.world.TickEvent;
|
| 9 | import meteordevelopment.meteorclient.settings.*;
|
| 10 | import meteordevelopment.meteorclient.systems.modules.Categories;
|
| 11 | import meteordevelopment.meteorclient.systems.modules.Module;
|
| 12 | import meteordevelopment.meteorclient.systems.modules.Modules;
|
| 13 | import meteordevelopment.meteorclient.systems.modules.world.Timer;
|
| 14 | import meteordevelopment.orbit.EventHandler;
|
| 15 | import net.minecraft.world.level.block.Blocks;
|
| 16 |
|
| 17 | public class NoSlow extends Module {
|
| 18 | private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
| 19 |
|
| 20 | private final Setting<Boolean> items = sgGeneral.add(new BoolSetting.Builder()
|
| 21 | .name("items")
|
| 22 | .description("Whether or not using items will slow you.")
|
| 23 | .defaultValue(true)
|
| 24 | .build()
|
| 25 | );
|
| 26 |
|
| 27 | private final Setting<WebMode> web = sgGeneral.add(new EnumSetting.Builder<WebMode>()
|
| 28 | .name("web")
|
| 29 | .description("Whether or not cobwebs will not slow you down.")
|
| 30 | .defaultValue(WebMode.Vanilla)
|
| 31 | .build()
|
| 32 | );
|
| 33 |
|
| 34 | private final Setting<Double> webTimer = sgGeneral.add(new DoubleSetting.Builder()
|
| 35 | .name("web-timer")
|
| 36 | .description("The timer value for WebMode Timer.")
|
| 37 | .defaultValue(10)
|
| 38 | .min(1)
|
| 39 | .sliderMin(1)
|
| 40 | .visible(() -> web.get() == WebMode.Timer)
|
| 41 | .build()
|
| 42 | );
|
| 43 |
|
| 44 | private final Setting<Boolean> honeyBlock = sgGeneral.add(new BoolSetting.Builder()
|
| 45 | .name("honey-block")
|
| 46 | .description("Whether or not honey blocks will not slow you down.")
|
| 47 | .defaultValue(true)
|
| 48 | .build()
|
| 49 | );
|
| 50 |
|
| 51 | private final Setting<Boolean> soulSand = sgGeneral.add(new BoolSetting.Builder()
|
| 52 | .name("soul-sand")
|
| 53 | .description("Whether or not soul sand will not slow you down.")
|
| 54 | .defaultValue(true)
|
| 55 | .build()
|
| 56 | );
|
| 57 |
|
| 58 | private final Setting<Boolean> slimeBlock = sgGeneral.add(new BoolSetting.Builder()
|
| 59 | .name("slime-block")
|
| 60 | .description("Whether or not slime blocks will not slow you down.")
|
| 61 | .defaultValue(true)
|
| 62 | .build()
|
| 63 | );
|
| 64 |
|
| 65 | private final Setting<Boolean> berryBush = sgGeneral.add(new BoolSetting.Builder()
|
| 66 | .name("berry-bush")
|
| 67 | .description("Whether or not berry bushes will not slow you down.")
|
| 68 | .defaultValue(true)
|
| 69 | .build()
|
| 70 | );
|
| 71 |
|
| 72 | private final Setting<Boolean> airStrict = sgGeneral.add(new BoolSetting.Builder()
|
| 73 | .name("air-strict")
|
| 74 | .description("Will attempt to bypass anti-cheats like 2b2t's. Only works while in air.")
|
| 75 | .defaultValue(false)
|
| 76 | .build()
|
| 77 | );
|
| 78 |
|
| 79 | private final Setting<Boolean> fluidDrag = sgGeneral.add(new BoolSetting.Builder()
|
| 80 | .name("fluid-drag")
|
| 81 | .description("Whether or not fluid drag will not slow you down.")
|
| 82 | .defaultValue(false)
|
| 83 | .build()
|
| 84 | );
|
| 85 |
|
| 86 | private final Setting<Boolean> sneaking = sgGeneral.add(new BoolSetting.Builder()
|
| 87 | .name("sneaking")
|
| 88 | .description("Whether or not sneaking will not slow you down.")
|
| 89 | .defaultValue(false)
|
| 90 | .build()
|
| 91 | );
|
| 92 |
|
| 93 | private final Setting<Boolean> hunger = sgGeneral.add(new BoolSetting.Builder()
|
| 94 | .name("hunger")
|
| 95 | .description("Whether or not hunger will not slow you down.")
|
| 96 | .defaultValue(false)
|
| 97 | .build()
|
| 98 | );
|
| 99 |
|
| 100 | private final Setting<Boolean> slowness = sgGeneral.add(new BoolSetting.Builder()
|
| 101 | .name("slowness")
|
| 102 | .description("Whether or not slowness will not slow you down.")
|
| 103 | .defaultValue(false)
|
| 104 | .build()
|
| 105 | );
|
| 106 |
|
| 107 | private boolean resetTimer;
|
| 108 |
|
| 109 | public NoSlow() {
|
| 110 | super(Categories.Movement, "no-slow", "Allows you to move normally when using objects that will slow you.");
|
| 111 | }
|
| 112 |
|
| 113 | @Override
|
| 114 | public void onActivate() {
|
| 115 | resetTimer = false;
|
| 116 | }
|
| 117 |
|
| 118 | public boolean airStrict() {
|
| 119 | return isActive() && airStrict.get() && mc.player.isUsingItem();
|
| 120 | }
|
| 121 |
|
| 122 | public boolean items() {
|
| 123 | return isActive() && items.get();
|
| 124 | }
|
| 125 |
|
| 126 | public boolean honeyBlock() {
|
| 127 | return isActive() && honeyBlock.get();
|
| 128 | }
|
| 129 |
|
| 130 | public boolean soulSand() {
|
| 131 | return isActive() && soulSand.get();
|
| 132 | }
|
| 133 |
|
| 134 | public boolean slimeBlock() {
|
| 135 | return isActive() && slimeBlock.get();
|
| 136 | }
|
| 137 |
|
| 138 | public boolean cobweb() {
|
| 139 | return isActive() && web.get() == WebMode.Vanilla;
|
| 140 | }
|
| 141 |
|
| 142 | public boolean berryBush() {
|
| 143 | return isActive() && berryBush.get();
|
| 144 | }
|
| 145 |
|
| 146 | public boolean fluidDrag() {
|
| 147 | return isActive() && fluidDrag.get();
|
| 148 | }
|
| 149 |
|
| 150 | public boolean sneaking() {
|
| 151 | return isActive() && sneaking.get();
|
| 152 | }
|
| 153 |
|
| 154 | public boolean hunger() {
|
| 155 | return isActive() && hunger.get();
|
| 156 | }
|
| 157 |
|
| 158 | public boolean slowness() {
|
| 159 | return isActive() && slowness.get();
|
| 160 | }
|
| 161 |
|
| 162 | @EventHandler
|
| 163 | private void onPreTick(TickEvent.Pre event) {
|
| 164 | if (web.get() == WebMode.Timer) {
|
| 165 | if (mc.level.getBlockState(mc.player.blockPosition()).getBlock() == Blocks.COBWEB && !mc.player.onGround()) {
|
| 166 | resetTimer = false;
|
| 167 | Modules.get().get(Timer.class).setOverride(webTimer.get());
|
| 168 | } else if (!resetTimer) {
|
| 169 | Modules.get().get(Timer.class).setOverride(Timer.OFF);
|
| 170 | resetTimer = true;
|
| 171 | }
|
| 172 | }
|
| 173 | }
|
| 174 |
|
| 175 | public enum WebMode {
|
| 176 | Vanilla,
|
| 177 | Timer,
|
| 178 | None
|
| 179 | }
|
| 180 | }
|
| 181 |
|