NoStun module

NoStun: Minecraft 26.3 cheat module, full source for every implementation (1 client: Combatant).

1 implementationMOVEMENT

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

CombatantMOVEMENTsrc/main/java/combatant/client/features/module/modules/movement/NoStun.javaJava · 571 lines · 20.9 KB
SettingsnoStunModenoStunFunctionsnoStunEnvBlocksnoStunVulcan297WebRationoStunVulcan297SoulSandRationoStunDebuffsnoStunEatSpeed
NoStun.javaJava · Minecraft 26.2 · 571 lines · 20.9 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Copyright (c) 2026 pivosos2007.
4
 *
5
 * Licensed under the GNU General Public License v3.0.
6
 */
7
8
package combatant.client.features.module.modules.movement;
9
10
import net.minecraft.client.Minecraft;
11
import net.minecraft.client.player.LocalPlayer;
12
import net.minecraft.core.BlockPos;
13
import net.minecraft.resources.Identifier;
14
import net.minecraft.util.Mth;
15
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
16
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
17
import net.minecraft.world.entity.ai.attributes.Attributes;
18
import net.minecraft.world.entity.player.Player;
19
import net.minecraft.world.level.block.Block;
20
import net.minecraft.world.level.block.Blocks;
21
import net.minecraft.world.level.block.state.BlockState;
22
import net.minecraft.world.phys.AABB;
23
import net.minecraft.world.phys.Vec3;
24
import combatant.client.config.values.BooleanMapValue;
25
import combatant.client.config.values.EnumValue;
26
import combatant.client.config.values.NumberValue;
27
import combatant.client.events.EventHandler;
28
import combatant.client.events.impl.EventCollision;
29
import combatant.client.events.impl.GameTickEvent;
30
import combatant.client.events.impl.MovementInputEvent;
31
import combatant.client.events.impl.PlayerJumpEvent;
32
import combatant.client.features.module.Module;
33
import combatant.client.features.module.ModuleCategory;
34
import combatant.client.features.module.ModuleInfo;
35
36
import java.util.LinkedHashMap;
37
import java.util.Map;
38
39
//todo Description
40
@ModuleInfo(
41
        id = "nostun",
42
        displayName = "NoStun",
43
        category = ModuleCategory.MOVEMENT
44
)
45
public class NoStun extends Module {
46
47
    private static final float DEFAULT_SLIPPERINESS = 0.6F;
48
    private static final float DEFAULT_VELOCITY_MULTIPLIER = 1.0F;
49
    private static final double VULCAN_297_WEB_BUFFER_MAX = 7.0;
50
    private static final double VULCAN_297_WEB_BUFFER_DECAY = 0.15;
51
    private static final double VULCAN_297_WEB_FULL_COST = 1.0;
52
    private static final double VULCAN_297_SPEED_E_BUFFER_MAX = 2.0;
53
    private static final double VULCAN_297_SPEED_E_BUFFER_DECAY = 0.025;
54
    private static final int VULCAN_297_SLOWNESS_JUMP_WINDOW_TICKS = 5;
55
    private static final double VULCAN_297_SLOWNESS_EXEMPT_RATIO = 1.0;
56
    private static final Identifier SLOWNESS_MOVEMENT_SPEED_MODIFIER_ID = Identifier.withDefaultNamespace("effect.slowness");
57
    private static final String SETTING_MODE = "mode";
58
    private static final String SETTING_FUNCTIONS = "functions";
59
    private static final String SETTING_ENV_BLOCKS = "env_blocks";
60
    private static final String SETTING_DEBUFFS = "debuffs";
61
    private static final String SETTING_EAT_SPEED = "eat_speed";
62
    private static final String SETTING_VULCAN_WEB_RATIO = "vulcan297_web_ratio";
63
    private static final String SETTING_VULCAN_SOUL_RATIO = "vulcan297_soul_sand_ratio";
64
    private static final String FN_USE_SPEED = "use_speed";
65
    private static final String FN_ENV_BLOCKS = "env_blocks";
66
    private static final String FN_NO_HURT_STUN = "no_hurt_stun";
67
    private static final String FN_DEBUFFS = "debuffs";
68
    private static final String ENV_WEB = "web";
69
    private static final String ENV_HONEY = "honey";
70
    private static final String ENV_SLIME = "slime";
71
    private static final String ENV_SOUL = "soul_sand";
72
    private static final String ENV_BERRY = "sweet_berry";
73
    private static final String DEBUFF_SLOWNESS = "slowness";
74
    private static final String DEBUFF_BLINDNESS = "blindness";
75
    private final Minecraft mc = Minecraft.getInstance();
76
    //todo ну хз на прыжках еще флагует блять так что хз хз
77
    private final EnumValue<Mode> mode =
78
            enumSetting("noStunMode", SETTING_MODE, Mode.NORMAL, Mode.values());
79
    private final BooleanMapValue functions =
80
            group("noStunFunctions", SETTING_FUNCTIONS, defaultFunctions());
81
    private final BooleanMapValue envBlocks =
82
            visibleWhen(group("noStunEnvBlocks", SETTING_ENV_BLOCKS, defaultEnvBlocks()), () -> functions.get(FN_ENV_BLOCKS));
83
    private final NumberValue<Double> vulcan297WebRatio =
84
            visibleWhen(num("noStunVulcan297WebRatio", SETTING_VULCAN_WEB_RATIO, 0.35, 0.0, 1.0),
85
                    () -> functions.get(FN_ENV_BLOCKS) && envBlocks.get(ENV_WEB) && isVulcan297());
86
    private final NumberValue<Double> vulcan297SoulSandRatio =
87
            visibleWhen(num("noStunVulcan297SoulSandRatio", SETTING_VULCAN_SOUL_RATIO, 0.35, 0.0, 1.0),
88
                    () -> functions.get(FN_ENV_BLOCKS) && envBlocks.get(ENV_SOUL) && isVulcan297());
89
    private final BooleanMapValue debuffs =
90
            visibleWhen(group("noStunDebuffs", SETTING_DEBUFFS, defaultDebuffs()), () -> functions.get(FN_DEBUFFS));
91
    private final NumberValue<Double> eatSpeed =
92
            visibleWhen(num("noStunEatSpeed", SETTING_EAT_SPEED, 0.0, 0.0, 1.0), () -> functions.get(FN_USE_SPEED));
93
    private double vulcan297WebBudget;
94
    private int vulcan297LastWebChargeAge = -1;
95
    private int vulcan297LastWebDecayAge = -1;
96
    private double vulcan297SlownessSpeedEBuffer;
97
    private int vulcan297SlownessJumpTicks;
98
    private int vulcan297LastSlownessDecisionAge = -1;
99
    private double vulcan297LastSlownessRatio;
100
101
    private static double blend(double ratio, double vanilla, double normalized) {
102
        return Mth.lerp(Mth.clamp(ratio, 0.0, 1.0), vanilla, normalized);
103
    }
104
105
    public static String fnUseSpeed() {
106
        return FN_USE_SPEED;
107
    }
108
109
    public static String fnEnvBlocks() {
110
        return FN_ENV_BLOCKS;
111
    }
112
113
    public static String fnNoHurtStun() {
114
        return FN_NO_HURT_STUN;
115
    }
116
117
    public static String fnDebuffs() {
118
        return FN_DEBUFFS;
119
    }
120
121
    public static String envWeb() {
122
        return ENV_WEB;
123
    }
124
125
    public static String envHoney() {
126
        return ENV_HONEY;
127
    }
128
129
    public static String envSlime() {
130
        return ENV_SLIME;
131
    }
132
133
    public static String envSoulSand() {
134
        return ENV_SOUL;
135
    }
136
137
    public static String envBerry() {
138
        return ENV_BERRY;
139
    }
140
141
    private static Map<String, Boolean> defaultFunctions() {
142
        Map<String, Boolean> m = new LinkedHashMap<>();
143
        m.put(FN_USE_SPEED, true);
144
        m.put(FN_ENV_BLOCKS, true);
145
        m.put(FN_NO_HURT_STUN, true);
146
        m.put(FN_DEBUFFS, true);
147
        return m;
148
    }
149
150
    private static Map<String, Boolean> defaultEnvBlocks() {
151
        Map<String, Boolean> m = new LinkedHashMap<>();
152
        m.put(ENV_WEB, true);
153
        m.put(ENV_HONEY, true);
154
        m.put(ENV_SLIME, true);
155
        m.put(ENV_BERRY, true);
156
        m.put(ENV_SOUL, true);
157
        return m;
158
    }
159
160
    private static Map<String, Boolean> defaultDebuffs() {
161
        Map<String, Boolean> m = new LinkedHashMap<>();
162
        m.put(DEBUFF_SLOWNESS, true);
163
        m.put(DEBUFF_BLINDNESS, true);
164
        return m;
165
    }
166
167
    @EventHandler
168
    private void onMovementInput(MovementInputEvent event) {
169
        if (shouldBlockWebJump() && event.isJump()) {
170
            event.setJump(false);
171
        }
172
    }
173
174
    @EventHandler
175
    private void onPlayerJump(PlayerJumpEvent event) {
176
        if (shouldBlockWebJump()) {
177
            event.cancel();
178
            return;
179
        }
180
181
        if (shouldUseVulcan297SlownessLogic(mc.player)) {
182
            vulcan297SlownessJumpTicks = VULCAN_297_SLOWNESS_JUMP_WINDOW_TICKS;
183
        }
184
    }
185
186
    @EventHandler
187
    private void onGameTick(GameTickEvent event) {
188
        if (!isEnabled() || !isVulcan297() || mc.player == null || mc.level == null) {
189
            resetVulcan297WebBudget();
190
            resetVulcan297SlownessSpeedEBuffer();
191
            return;
192
        }
193
194
        if (!isInsideWeb(mc.player)) {
195
            decayVulcan297WebBudget();
196
            vulcan297LastWebChargeAge = -1;
197
        }
198
199
        if (vulcan297SlownessJumpTicks > 0) {
200
            vulcan297SlownessJumpTicks--;
201
        }
202
        if (!shouldUseVulcan297SlownessLogic(mc.player)) {
203
            resetVulcan297SlownessSpeedEBuffer();
204
        }
205
    }
206
207
    @EventHandler
208
    private void onCollision(EventCollision event) {
209
        if (shouldMakeWebSolidWhileGliding(event.getState(), event.getPos())) {
210
            event.setState(Blocks.BARRIER.defaultBlockState());
211
        }
212
    }
213
214
    @Override
215
    public void onDisable() {
216
        resetVulcan297WebBudget();
217
        resetVulcan297SlownessSpeedEBuffer();
218
    }
219
220
    public boolean isFunctionEnabled(String key) {
221
        return functions.get(key);
222
    }
223
224
    public boolean isEnvBlockEnabled(String key) {
225
        return envBlocks.get(key);
226
    }
227
228
    public boolean isEnvBlocksEnabled() {
229
        return functions.get(FN_ENV_BLOCKS);
230
    }
231
232
    public boolean isVulcan297() {
233
        return mode.get() == Mode.VULCAN_297;
234
    }
235
236
    public float getEatSpeed01() {
237
        return (float) Mth.clamp(eatSpeed.get(), 0.0, 1.0);
238
    }
239
240
    public boolean shouldIgnoreBlindness(Player player) {
241
        return isEnabled() && isLocalPlayer(player) && functions.get(FN_DEBUFFS) && debuffs.get(DEBUFF_BLINDNESS);
242
    }
243
244
    public double getMovementSpeedAttributeWithoutSlowness(Player player, double original) {
245
        if (!isEnabled() || !isLocalPlayer(player) || !functions.get(FN_DEBUFFS) || !debuffs.get(DEBUFF_SLOWNESS)) {
246
            return original;
247
        }
248
249
        AttributeInstance movementSpeed = player.getAttribute(Attributes.MOVEMENT_SPEED);
250
        if (movementSpeed == null || !movementSpeed.hasModifier(SLOWNESS_MOVEMENT_SPEED_MODIFIER_ID)) {
251
            return original;
252
        }
253
254
        double noSlowness = computeMovementSpeedWithoutSlownessModifier(movementSpeed);
255
        if (!isVulcan297()) {
256
            return noSlowness;
257
        }
258
259
        double ratio = getVulcan297SlownessRatio(player, movementSpeed);
260
        return blend(ratio, original, noSlowness);
261
    }
262
263
    private double computeMovementSpeedWithoutSlownessModifier(AttributeInstance movementSpeed) {
264
        double base = movementSpeed.getBaseValue();
265
        double value = base;
266
267
        for (AttributeModifier modifier : movementSpeed.getModifiers()) {
268
            if (isMovementSpeedModifier(modifier, AttributeModifier.Operation.ADD_VALUE)) {
269
                value += modifier.amount();
270
            }
271
        }
272
273
        double multipliedBase = value;
274
        for (AttributeModifier modifier : movementSpeed.getModifiers()) {
275
            if (isMovementSpeedModifier(modifier, AttributeModifier.Operation.ADD_MULTIPLIED_BASE)) {
276
                multipliedBase += base * modifier.amount();
277
            }
278
        }
279
280
        for (AttributeModifier modifier : movementSpeed.getModifiers()) {
281
            if (isMovementSpeedModifier(modifier, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)) {
282
                multipliedBase *= 1.0 + modifier.amount();
283
            }
284
        }
285
286
        return Attributes.MOVEMENT_SPEED.value().sanitizeValue(multipliedBase);
287
    }
288
289
    private boolean isMovementSpeedModifier(AttributeModifier modifier, AttributeModifier.Operation operation) {
290
        return modifier.operation() == operation && !modifier.is(SLOWNESS_MOVEMENT_SPEED_MODIFIER_ID);
291
    }
292
293
    private double getVulcan297SlownessRatio(Player player, AttributeInstance movementSpeed) {
294
        int age = player.tickCount;
295
        if (age == vulcan297LastSlownessDecisionAge) {
296
            return vulcan297LastSlownessRatio;
297
        }
298
299
        int slownessLevel = getSlownessLevel(movementSpeed);
300
        double ratio;
301
        if (isVulcan297SpeedEPredictionExempt(player)) {
302
            ratio = VULCAN_297_SLOWNESS_EXEMPT_RATIO;
303
            decayVulcan297SlownessSpeedEBuffer();
304
        } else if (shouldUseVulcan297SlownessJumpRatio(player)) {
305
            double cost = getVulcan297SlownessJumpCost(slownessLevel);
306
            if (canChargeVulcan297SlownessSpeedEBuffer(cost)) {
307
                ratio = getVulcan297SlownessJumpRatio(slownessLevel);
308
                chargeVulcan297SlownessSpeedEBuffer(cost);
309
            } else {
310
                ratio = getVulcan297SlownessWalkRatio(slownessLevel);
311
                decayVulcan297SlownessSpeedEBuffer();
312
            }
313
        } else {
314
            ratio = getVulcan297SlownessWalkRatio(slownessLevel);
315
            decayVulcan297SlownessSpeedEBuffer();
316
        }
317
318
        vulcan297LastSlownessDecisionAge = age;
319
        vulcan297LastSlownessRatio = ratio;
320
        return ratio;
321
    }
322
323
    private int getSlownessLevel(AttributeInstance movementSpeed) {
324
        AttributeModifier modifier = movementSpeed.getModifier(SLOWNESS_MOVEMENT_SPEED_MODIFIER_ID);
325
        if (modifier == null) {
326
            return 0;
327
        }
328
329
        return Math.max(1, (int) Math.round(Math.abs(modifier.amount()) / 0.15));
330
    }
331
332
    private double getVulcan297SlownessWalkRatio(int slownessLevel) {
333
        if (slownessLevel >= 6) return 0.28;
334
        if (slownessLevel >= 4) return 0.42;
335
        if (slownessLevel >= 2) return 0.70;
336
        return 1.0;
337
    }
338
339
    private double getVulcan297SlownessJumpRatio(int slownessLevel) {
340
        if (slownessLevel >= 6) return 0.58;
341
        if (slownessLevel >= 4) return 0.78;
342
        return 1.0;
343
    }
344
345
    private double getVulcan297SlownessJumpCost(int slownessLevel) {
346
        if (slownessLevel >= 6) return 0.70;
347
        if (slownessLevel >= 4) return 0.50;
348
        return 0.35;
349
    }
350
351
    private boolean shouldUseVulcan297SlownessJumpRatio(Player player) {
352
        return player != null
353
                && vulcan297SlownessJumpTicks > 0
354
                && !player.onGround()
355
                && !player.isFallFlying()
356
                && player.getDeltaMovement().y > -0.08;
357
    }
358
359
    private boolean shouldUseVulcan297SlownessLogic(Player player) {
360
        if (player == null || !isEnabled() || !isVulcan297() || !functions.get(FN_DEBUFFS) || !debuffs.get(DEBUFF_SLOWNESS)) {
361
            return false;
362
        }
363
364
        AttributeInstance movementSpeed = player.getAttribute(Attributes.MOVEMENT_SPEED);
365
        return movementSpeed != null && movementSpeed.hasModifier(SLOWNESS_MOVEMENT_SPEED_MODIFIER_ID);
366
    }
367
368
    private boolean canChargeVulcan297SlownessSpeedEBuffer(double cost) {
369
        return vulcan297SlownessSpeedEBuffer + cost <= VULCAN_297_SPEED_E_BUFFER_MAX;
370
    }
371
372
    private void chargeVulcan297SlownessSpeedEBuffer(double cost) {
373
        vulcan297SlownessSpeedEBuffer = Math.min(VULCAN_297_SPEED_E_BUFFER_MAX, vulcan297SlownessSpeedEBuffer + cost);
374
    }
375
376
    private void decayVulcan297SlownessSpeedEBuffer() {
377
        vulcan297SlownessSpeedEBuffer = Math.max(0.0, vulcan297SlownessSpeedEBuffer - VULCAN_297_SPEED_E_BUFFER_DECAY);
378
    }
379
380
    private void resetVulcan297SlownessSpeedEBuffer() {
381
        vulcan297SlownessSpeedEBuffer = 0.0;
382
        vulcan297SlownessJumpTicks = 0;
383
        vulcan297LastSlownessDecisionAge = -1;
384
        vulcan297LastSlownessRatio = 0.0;
385
    }
386
387
    private boolean isVulcan297SpeedEPredictionExempt(Player player) {
388
        if (player == null || player.level() == null) return false;
389
        if (player.getAbilities().instabuild || player.getAbilities().flying) return true;
390
        if (player.isFallFlying() || player.isAutoSpinAttack() || player.isPassenger() || player.isSleeping())
391
            return true;
392
393
        BlockPos feetPos = player.blockPosition();
394
        Block feet = player.level().getBlockState(feetPos).getBlock();
395
        Block below = player.level().getBlockState(feetPos.below()).getBlock();
396
397
        return isVulcan297SpeedEPredictionExemptBlock(feet)
398
                || isVulcan297SpeedEPredictionExemptBlock(below);
399
    }
400
401
    private boolean isVulcan297SpeedEPredictionExemptBlock(Block block) {
402
        return block == Blocks.COBWEB || block == Blocks.HONEY_BLOCK;
403
    }
404
405
    public Vec3 getSlowMovementOverride(BlockState state, Vec3 vanillaMultiplier) {
406
        if (!isEnabled() || state == null || vanillaMultiplier == null || !functions.get(FN_ENV_BLOCKS)) {
407
            return null;
408
        }
409
410
        if (state.is(Blocks.COBWEB) && envBlocks.get(ENV_WEB) && isVulcan297()) {
411
            if (shouldUseFullVulcan297WebBypass()) {
412
                return null;
413
            }
414
415
            decayVulcan297WebBudget();
416
            double horizontal = blend(vulcan297WebRatio.get(), vanillaMultiplier.x, 1.0);
417
            return new Vec3(horizontal, vanillaMultiplier.y, horizontal);
418
        }
419
420
        return null;
421
    }
422
423
    public boolean shouldCancelSlowMovement(BlockState state) {
424
        if (!isEnabled() || state == null || !functions.get(FN_ENV_BLOCKS)) {
425
            return false;
426
        }
427
        if (state.is(Blocks.COBWEB) && envBlocks.get(ENV_WEB)) {
428
            if (!isVulcan297()) {
429
                return true;
430
            }
431
            if (shouldUseFullVulcan297WebBypass()) {
432
                chargeVulcan297WebBudget();
433
                return true;
434
            }
435
            return false;
436
        }
437
        return state.is(Blocks.SWEET_BERRY_BUSH) && envBlocks.get(ENV_BERRY);
438
    }
439
440
    public Float getSlipperinessOverride(Block block, float vanilla) {
441
        if (!isEnabled() || block == null || !functions.get(FN_ENV_BLOCKS)) {
442
            return null;
443
        }
444
445
        if (block == Blocks.SLIME_BLOCK && envBlocks.get(ENV_SLIME)
446
                || block == Blocks.HONEY_BLOCK && envBlocks.get(ENV_HONEY)) {
447
            return isVulcan297()
448
                    ? (float) blend(vulcan297SoulSandRatio.get(), vanilla, DEFAULT_SLIPPERINESS)
449
                    : DEFAULT_SLIPPERINESS;
450
        }
451
452
        return null;
453
    }
454
455
    public Float getVelocityMultiplierOverride(Block block, float vanilla) {
456
        if (!isEnabled() || block == null || !functions.get(FN_ENV_BLOCKS)) {
457
            return null;
458
        }
459
460
        if (block == Blocks.HONEY_BLOCK && envBlocks.get(ENV_HONEY)) {
461
            return isVulcan297()
462
                    ? (float) blend(vulcan297SoulSandRatio.get(), vanilla, DEFAULT_VELOCITY_MULTIPLIER)
463
                    : DEFAULT_VELOCITY_MULTIPLIER;
464
        }
465
466
        if (block == Blocks.SOUL_SAND && envBlocks.get(ENV_SOUL)) {
467
            return getSoulSandVelocityMultiplier(vanilla);
468
        }
469
470
        return null;
471
    }
472
473
    public float getSoulSandVelocityMultiplier(float vanilla) {
474
        if (!isEnabled() || !functions.get(FN_ENV_BLOCKS) || !envBlocks.get(ENV_SOUL)) {
475
            return vanilla;
476
        }
477
        if (isVulcan297()) {
478
            return (float) blend(vulcan297SoulSandRatio.get(), vanilla, DEFAULT_VELOCITY_MULTIPLIER);
479
        }
480
        return vanilla < 1.0F ? 1.0F : vanilla;
481
    }
482
483
    private boolean shouldBlockWebJump() {
484
        return isEnabled()
485
                && functions.get(FN_ENV_BLOCKS)
486
                && envBlocks.get(ENV_WEB)
487
                && mc.player != null
488
                && isInsideWeb(mc.player);
489
    }
490
491
    private boolean shouldMakeWebSolidWhileGliding(BlockState state, BlockPos pos) {
492
        if (state == null || pos == null || !state.is(Blocks.COBWEB)) return false;
493
        if (!isEnabled() || !isVulcan297() || !functions.get(FN_ENV_BLOCKS) || !envBlocks.get(ENV_WEB)) return false;
494
        if (mc.player == null || mc.level == null || !mc.player.isFallFlying() || mc.player.isSpectator()) return false;
495
496
        AABB movementBox = mc.player.getBoundingBox()
497
                .expandTowards(mc.player.getDeltaMovement())
498
                .inflate(0.2);
499
        return movementBox.intersects(new AABB(pos));
500
    }
501
502
    private boolean isInsideWeb(LocalPlayer player) {
503
        if (mc.level == null) return false;
504
505
        AABB box = player.getBoundingBox().deflate(1.0E-4);
506
        int minX = Mth.floor(box.minX);
507
        int minY = Mth.floor(box.minY);
508
        int minZ = Mth.floor(box.minZ);
509
        int maxX = Mth.floor(box.maxX);
510
        int maxY = Mth.floor(box.maxY);
511
        int maxZ = Mth.floor(box.maxZ);
512
513
        for (int x = minX; x <= maxX; x++) {
514
            for (int y = minY; y <= maxY; y++) {
515
                for (int z = minZ; z <= maxZ; z++) {
516
                    if (mc.level.getBlockState(new BlockPos(x, y, z)).is(Blocks.COBWEB)) {
517
                        return true;
518
                    }
519
                }
520
            }
521
        }
522
523
        return false;
524
    }
525
526
    private boolean canUseVulcan297WebBurst() {
527
        return vulcan297WebBudget + VULCAN_297_WEB_FULL_COST <= VULCAN_297_WEB_BUFFER_MAX;
528
    }
529
530
    private boolean shouldUseFullVulcan297WebBypass() {
531
        return canUseVulcan297WebBurst();
532
    }
533
534
    private void chargeVulcan297WebBudget() {
535
        LocalPlayer player = mc.player;
536
        int age = player != null ? player.tickCount : -1;
537
        if (age == vulcan297LastWebChargeAge) {
538
            return;
539
        }
540
541
        vulcan297WebBudget = Math.min(VULCAN_297_WEB_BUFFER_MAX, vulcan297WebBudget + VULCAN_297_WEB_FULL_COST);
542
        vulcan297LastWebChargeAge = age;
543
    }
544
545
    private void decayVulcan297WebBudget() {
546
        LocalPlayer player = mc.player;
547
        int age = player != null ? player.tickCount : -1;
548
        if (age == vulcan297LastWebDecayAge) {
549
            return;
550
        }
551
552
        vulcan297WebBudget = Math.max(0.0, vulcan297WebBudget - VULCAN_297_WEB_BUFFER_DECAY);
553
        vulcan297LastWebDecayAge = age;
554
    }
555
556
    private void resetVulcan297WebBudget() {
557
        vulcan297WebBudget = 0.0;
558
        vulcan297LastWebChargeAge = -1;
559
        vulcan297LastWebDecayAge = -1;
560
    }
561
562
    private boolean isLocalPlayer(Player player) {
563
        return player != null && mc != null && player == mc.player;
564
    }
565
566
    public enum Mode {
567
        NORMAL,
568
        VULCAN_297
569
    }
570
}
571