forked from cev-api/Wurst7-CevAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHackList.java
More file actions
514 lines (480 loc) · 23.7 KB
/
Copy pathHackList.java
File metadata and controls
514 lines (480 loc) · 23.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
/*
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hack;
import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import net.minecraft.CrashReport;
import net.minecraft.ReportedException;
import net.wurstclient.WurstClient;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hacks.*;
import net.wurstclient.hacks.spawnradius.SpawnRadiusHack;
import net.wurstclient.util.json.JsonException;
public final class HackList implements UpdateListener
{
public final AimAssistHack aimAssistHack = new AimAssistHack();
public final AirPlaceHack airPlaceHack = new AirPlaceHack();
public final AirWalkHack airWalkHack = new AirWalkHack();
public final AnchorAuraHack anchorAuraHack = new AnchorAuraHack();
public final AntiAfkHack antiAfkHack = new AntiAfkHack();
public final AntiBlindHack antiBlindHack = new AntiBlindHack();
public final AntiCactusHack antiCactusHack = new AntiCactusHack();
public final AntiCheatDetectHack antiCheatDetectHack =
new AntiCheatDetectHack();
public final AntiDropHack antiDropHack = new AntiDropHack();
public final AntiBlastHack antiBlastHack = new AntiBlastHack();
public final AntiEntityPushHack antiEntityPushHack =
new AntiEntityPushHack();
public final AntiHungerHack antiHungerHack = new AntiHungerHack();
public final AntiKnockbackHack antiKnockbackHack = new AntiKnockbackHack();
public final AntiSpamHack antiSpamHack = new AntiSpamHack();
public final AntisocialHack antisocialHack = new AntisocialHack();
public final AntiVoidHack antiVoidHack = new AntiVoidHack();
public final AntiWaterPushHack antiWaterPushHack = new AntiWaterPushHack();
public final AntiWobbleHack antiWobbleHack = new AntiWobbleHack();
public final AntiProjectileHack antiProjectileHack =
new AntiProjectileHack();
public final ArrowDmgHack arrowDmgHack = new ArrowDmgHack();
public final AttributeSwapHack attributeSwapHack = new AttributeSwapHack();
public final AutoArmorHack autoArmorHack = new AutoArmorHack();
public final AutoBuildHack autoBuildHack = new AutoBuildHack();
public final AutoChatHack autoChatHack = new AutoChatHack();
public final CommandScannerHack commandScannerHack =
new CommandScannerHack();
public final AutoCompleteHack autoCompleteHack = new AutoCompleteHack();
public final AutoDisenchantHack autoDisenchantHack =
new AutoDisenchantHack();
public final AutoDropHack autoDropHack = new AutoDropHack();
public final InstantCommandHack instantCommandHack =
new InstantCommandHack();
public final JoinDropHack joinDropHack = new JoinDropHack();
public final SusNoMoreHack susNoMoreHack = new SusNoMoreHack();
public final AutoLeaveHack autoLeaveHack = new AutoLeaveHack();
public final AutoLibrarianHack autoLibrarianHack = new AutoLibrarianHack();
public final AutoTraderHack autoTraderHack = new AutoTraderHack();
public final AutoEatHack autoEatHack = new AutoEatHack();
public final AutoFarmHack autoFarmHack = new AutoFarmHack();
public final AutoFishHack autoFishHack = new AutoFishHack();
public final AutoFlyHack autoFlyHack = new AutoFlyHack();
public final AutoMaceHack autoMaceHack = new AutoMaceHack();
public final AutoMineHack autoMineHack = new AutoMineHack();
public final AutoPotionHack autoPotionHack = new AutoPotionHack();
public final AutoReconnectHack autoReconnectHack = new AutoReconnectHack();
public final OfflineSettingsHack offlineSettingsHack =
new OfflineSettingsHack();
public final AutoRespawnHack autoRespawnHack = new AutoRespawnHack();
public final AutoSignHack autoSignHack = new AutoSignHack();
public final AutoSoupHack autoSoupHack = new AutoSoupHack();
public final AutoSprintHack autoSprintHack = new AutoSprintHack();
public final AutoStealHack autoStealHack = new AutoStealHack();
public final AutoSwimHack autoSwimHack = new AutoSwimHack();
public final AutoSwitchHack autoSwitchHack = new AutoSwitchHack();
public final AutoSwordHack autoSwordHack = new AutoSwordHack();
public final AutoToolHack autoToolHack = new AutoToolHack();
public final AutoTotemHack autoTotemHack = new AutoTotemHack();
public final SoulChaliceHack soulChaliceHack = new SoulChaliceHack();
public final SkyBuildEspHack skyBuildEspHack = new SkyBuildEspHack();
public final AutoWalkHack autoWalkHack = new AutoWalkHack();
public final WindChargeKeyHack windChargeKeyHack = new WindChargeKeyHack();
public final XCarryHack xCarryHack = new XCarryHack();
public final BarrierEspHack barrierEspHack = new BarrierEspHack();
public final BacktrackHack backtrackHack = new BacktrackHack();
public final BaseFinderHack baseFinderHack = new BaseFinderHack();
public final BeaconExploitHack beaconExploitHack = new BeaconExploitHack();
public final BlinkHack blinkHack = new BlinkHack();
public final BoatFlyHack boatFlyHack = new BoatFlyHack();
public final BonemealAuraHack bonemealAuraHack = new BonemealAuraHack();
public final BowAimbotHack bowAimbotHack = new BowAimbotHack();
public final BuildRandomHack buildRandomHack = new BuildRandomHack();
public final BunnyHopHack bunnyHopHack = new BunnyHopHack();
public final CameraDistanceHack cameraDistanceHack =
new CameraDistanceHack();
public final CameraNoClipHack cameraNoClipHack = new CameraNoClipHack();
public final CaveFinderHack caveFinderHack = new CaveFinderHack();
public final CheatDetectorHack cheatDetectorHack = new CheatDetectorHack();
public final ChorusFruitHack chorusFruitHack = new ChorusFruitHack();
public final DamageDetectHack damageDetectHack = new DamageDetectHack();
public final LivestreamDetectorHack livestreamDetectorHack =
new LivestreamDetectorHack();
public final ChatTranslatorHack chatTranslatorHack =
new ChatTranslatorHack();
public final ChestEspHack chestEspHack = new ChestEspHack();
public final BedEspHack bedEspHack = new BedEspHack();
public final BedBreakAuraHack bedBreakAuraHack = new BedBreakAuraHack();
public final GlobalToggleHack globalToggleHack = new GlobalToggleHack();
public final EnchantmentHandlerHack enchantmentHandlerHack =
new EnchantmentHandlerHack();
public final ClickAuraHack clickAuraHack = new ClickAuraHack();
public final ClickGuiHack clickGuiHack = new ClickGuiHack();
public final AltGuiHack altGuiHack = new AltGuiHack();
public final XpGuiHack xpGuiHack = new XpGuiHack();
public final CrashChestHack crashChestHack = new CrashChestHack();
public final BundleDupeHack bundleDupeHack = new BundleDupeHack();
public final CreativeFlightHack creativeFlightHack =
new CreativeFlightHack();
public final CriticalsHack criticalsHack = new CriticalsHack();
public final CrystalAuraHack crystalAuraHack = new CrystalAuraHack();
public final DerpHack derpHack = new DerpHack();
public final TunnelHoleStairEspHack tunnelHoleStairEspHack =
new TunnelHoleStairEspHack();
public final DolphinHack dolphinHack = new DolphinHack();
public final ElytraFlightHack elytraFlightHack = new ElytraFlightHack();
public final ElytraInfoHack elytraInfoHack = new ElytraInfoHack();
public final EntityControlHack entityControlHack = new EntityControlHack();
public final ExcavatorHack excavatorHack = new ExcavatorHack();
public final ExtraElytraHack extraElytraHack = new ExtraElytraHack();
public final FancyChatHack fancyChatHack = new FancyChatHack();
public final FakeLagHack fakeLagHack = new FakeLagHack();
public final FastBreakHack fastBreakHack = new FastBreakHack();
public final FastLadderHack fastLadderHack = new FastLadderHack();
public final FastPlaceHack fastPlaceHack = new FastPlaceHack();
public final FeedAuraHack feedAuraHack = new FeedAuraHack();
public final FightBotHack fightBotHack = new FightBotHack();
public final FishHack fishHack = new FishHack();
public final FlightHack flightHack = new FlightHack();
public final FollowHack followHack = new FollowHack();
public final ForceOpHack forceOpHack = new ForceOpHack();
public final FreecamHack freecamHack = new FreecamHack();
public final FullbrightHack fullbrightHack = new FullbrightHack();
public final FunCreepersHack funCreepersHack = new FunCreepersHack();
public final GlideHack glideHack = new GlideHack();
public final HandNoClipHack handNoClipHack = new HandNoClipHack();
public final HeadRollHack headRollHack = new HeadRollHack();
public final HealthTagsHack healthTagsHack = new HealthTagsHack();
public final HideModMenuHack hideModMenuHack = new HideModMenuHack();
public final HideWurstHack hideWurstHack = new HideWurstHack();
public final DurabilityHudHack durabilityHudHack = new DurabilityHudHack();
public final GameStatsHack gameStatsHack = new GameStatsHack();
public final ClientChatOverlayHack clientChatOverlayHack =
new ClientChatOverlayHack();
public final HighJumpHack highJumpHack = new HighJumpHack();
public final InfiniChatHack infiniChatHack = new InfiniChatHack();
public final InstaBuildHack instaBuildHack = new InstaBuildHack();
public final InstantBunkerHack instantBunkerHack = new InstantBunkerHack();
public final InvWalkHack invWalkHack = new InvWalkHack();
public final ItemEspHack itemEspHack = new ItemEspHack();
public final ItemGeneratorHack itemGeneratorHack = new ItemGeneratorHack();
public final net.wurstclient.hacks.itemhandler.ItemHandlerHack itemHandlerHack =
new net.wurstclient.hacks.itemhandler.ItemHandlerHack();
public final SignFramePTHack signFramePTHack = new SignFramePTHack();
public final JesusHack jesusHack = new JesusHack();
public final JetpackHack jetpackHack = new JetpackHack();
public final KaboomHack kaboomHack = new KaboomHack();
public final KickForensicsHack kickForensicsHack = new KickForensicsHack();
public final BookBotHack bookBotHack = new BookBotHack();
public final KillauraLegitHack killauraLegitHack = new KillauraLegitHack();
public final KillauraHack killauraHack = new KillauraHack();
public final KillPotionHack killPotionHack = new KillPotionHack();
public final LiquidsHack liquidsHack = new LiquidsHack();
public final LsdHack lsdHack = new LsdHack();
public final MaceDmgHack maceDmgHack = new MaceDmgHack();
public final MentionHack mentionHack = new MentionHack();
public final MiningEvidenceHack miningEvidenceHack =
new MiningEvidenceHack();
public final SpearAssistHack spearAssistHack = new SpearAssistHack();
public final MassTpaHack massTpaHack = new MassTpaHack();
public final BedrockEscapeHack bedrockEscapeHack = new BedrockEscapeHack();
public final BedrockStashHack bedrockStashHack = new BedrockStashHack();
public final StasisDetectorHack stasisDetectorHack =
new StasisDetectorHack();
public final TeleportHack teleportHack = new TeleportHack();
public final MileyCyrusHack mileyCyrusHack = new MileyCyrusHack();
public final MeasurementEspHack measurementEspHack =
new MeasurementEspHack();
public final MobHealthHack mobHealthHack = new MobHealthHack();
public final MobOwnersHack mobOwnersHack = new MobOwnersHack();
public final MobEspHack mobEspHack = new MobEspHack();
public final WardenEspHack wardenEspHack = new WardenEspHack();
public final MobSearchHack mobSearchHack = new MobSearchHack();
public final MobSpawnEspHack mobSpawnEspHack = new MobSpawnEspHack();
public final MusicAuraHack musicAuraHack = new MusicAuraHack();
public final MultiAuraHack multiAuraHack = new MultiAuraHack();
public final NameProtectHack nameProtectHack = new NameProtectHack();
public final NameTagsHack nameTagsHack = new NameTagsHack();
public final NecoModeHack necoModeHack = new NecoModeHack();
public final NoGoZoneHack noGoZoneHack = new NoGoZoneHack();
public final NavigatorHack navigatorHack = new NavigatorHack();
public final NewChunksHack newChunksHack = new NewChunksHack();
public final NewerNewChunksHack newerNewChunksHack =
new NewerNewChunksHack();
public final NbtFilterHack nbtFilterHack = new NbtFilterHack();
public final NbtSizeCounterHack nbtSizeCounterHack =
new NbtSizeCounterHack();
public final NoBackgroundHack noBackgroundHack = new NoBackgroundHack();
public final NoClipHack noClipHack = new NoClipHack();
public final NoFallHack noFallHack = new NoFallHack();
public final NoFireOverlayHack noFireOverlayHack = new NoFireOverlayHack();
public final NoFogHack noFogHack = new NoFogHack();
public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack();
public final NoLevitationHack noLevitationHack = new NoLevitationHack();
public final NoOverlayHack noOverlayHack = new NoOverlayHack();
public final NoPlayerChatHack noPlayerChatHack = new NoPlayerChatHack();
public final NoPumpkinHack noPumpkinHack = new NoPumpkinHack();
public final NoShieldOverlayHack noShieldOverlayHack =
new NoShieldOverlayHack();
public final NoSlowdownHack noSlowdownHack = new NoSlowdownHack();
public final NoVignetteHack noVignetteHack = new NoVignetteHack();
public final NoWeatherHack noWeatherHack = new NoWeatherHack();
public final NoWebHack noWebHack = new NoWebHack();
public final NukerHack nukerHack = new NukerHack();
public final NukerLegitHack nukerLegitHack = new NukerLegitHack();
public final OpenWaterEspHack openWaterEspHack = new OpenWaterEspHack();
public final LavaWaterEspHack lavaWaterEspHack = new LavaWaterEspHack();
public final MapaHack mapaHack = new MapaHack();
public final OverlayHack overlayHack = new OverlayHack();
public final PanicHack panicHack = new PanicHack();
public final PacketDelayHack packetDelayHack = new PacketDelayHack();
public final PacketRateHack packetRateHack = new PacketRateHack();
public final ParkourHack parkourHack = new ParkourHack();
public final PlaceNBreakHack placeNBreakHack = new PlaceNBreakHack();
public final PlayerEspHack playerEspHack = new PlayerEspHack();
public final PlayerSonarHack playerSonarHack = new PlayerSonarHack();
public final PortalEspHack portalEspHack = new PortalEspHack();
public final PotEspHack potEspHack = new PotEspHack();
public final PortalGuiHack portalGuiHack = new PortalGuiHack();
public final PotionSaverHack potionSaverHack = new PotionSaverHack();
public final ProjectileEspHack projectileEspHack = new ProjectileEspHack();
public final ProphuntEspHack prophuntEspHack = new ProphuntEspHack();
public final ProtectHack protectHack = new ProtectHack();
public final QuickShulkerHack quickShulkerHack = new QuickShulkerHack();
public final RadarHack radarHack = new RadarHack();
public final RainbowUiHack rainbowUiHack = new RainbowUiHack();
public final RenderAdjustHack renderAdjustHack = new RenderAdjustHack();
public final RoofEspHack roofEspHack = new RoofEspHack();
public final InfiniteReachHack infiniteReachHack = new InfiniteReachHack();
public final ReachHack reachHack = new ReachHack();
public final RemoteViewHack remoteViewHack = new RemoteViewHack();
public final RemoteEnderChestHack remoteEnderChestHack =
new RemoteEnderChestHack();
public final RestockHack restockHack = new RestockHack();
public final SafeTpHack safeTpHack = new SafeTpHack();
public final SafeWalkHack safeWalkHack = new SafeWalkHack();
public final ScaffoldWalkHack scaffoldWalkHack = new ScaffoldWalkHack();
public final SearchHack searchHack = new SearchHack();
public final SourceFillHack sourceFillHack = new SourceFillHack();
public final SpawnRadiusHack spawnRadiusHack = new SpawnRadiusHack();
public final SeedMapperHelperHack seedMapperHelperHack =
new SeedMapperHelperHack();
public final SignEspHack signEspHack = new SignEspHack();
public final ShieldSwingHack shieldSwingHack = new ShieldSwingHack();
public final WorkstationEspHack workstationEspHack =
new WorkstationEspHack();
public final RedstoneEspHack redstoneEspHack = new RedstoneEspHack();
public final SkinDerpHack skinDerpHack = new SkinDerpHack();
public final SilkOnlyHack silkOnlyHack = new SilkOnlyHack();
public final SneakHack sneakHack = new SneakHack();
public final SnowShoeHack snowShoeHack = new SnowShoeHack();
public final SpeedHackHack speedHackHack = new SpeedHackHack();
public final SpeedNukerHack speedNukerHack = new SpeedNukerHack();
public final SuperInstaMineHack superInstaMineHack =
new SuperInstaMineHack();
public final SpiderHack spiderHack = new SpiderHack();
public final StepHack stepHack = new StepHack();
public final TemplateToolHack templateToolHack = new TemplateToolHack();
public final ThrowHack throwHack = new ThrowHack();
public final TillauraHack tillauraHack = new TillauraHack();
public final TimerHack timerHack = new TimerHack();
public final TargetPlaceHack targetPlaceHack = new TargetPlaceHack();
public final TiredHack tiredHack = new TiredHack();
public final TooManyHaxHack tooManyHaxHack = new TooManyHaxHack();
public final UiUtilsHack uiUtilsHack = new UiUtilsHack();
public final TpAuraHack tpAuraHack = new TpAuraHack();
public final TrajectoriesHack trajectoriesHack = new TrajectoriesHack();
public final TreeBotHack treeBotHack = new TreeBotHack();
public final TrialSpawnerEspHack trialSpawnerEspHack =
new TrialSpawnerEspHack();
public final TriggerBotHack triggerBotHack = new TriggerBotHack();
public final OutreachHack outreachHack = new OutreachHack();
public final TrollPotionHack trollPotionHack = new TrollPotionHack();
public final TrueSightHack trueSightHack = new TrueSightHack();
public final TunnellerHack tunnellerHack = new TunnellerHack();
public final SurfaceXrayHack surfaceXrayHack = new SurfaceXrayHack();
public final StaffMonitorHack staffMonitorHack = new StaffMonitorHack();
public final VeinMinerHack veinMinerHack = new VeinMinerHack();
public final XRayHack xRayHack = new XRayHack();
public final WaypointsHack waypointsHack = new WaypointsHack();
public final ViewmodelHack viewmodelHack = new ViewmodelHack();
public final WebhookAlertHack webhookAlertHack = new WebhookAlertHack();
public final OppStatsHack oppStatsHack = new OppStatsHack();
public final BreadcrumbsHack breadcrumbsHack = new BreadcrumbsHack();
public final LogoutSpotsHack logoutSpotsHack = new LogoutSpotsHack();
public final TridentEspHack tridentEspHack = new TridentEspHack();
public final PearlEspHack pearlEspHack = new PearlEspHack();
public final PearlInterceptHack pearlInterceptHack =
new PearlInterceptHack();
public final ChestSearchHack chestSearchHack = new ChestSearchHack();
public final net.wurstclient.hacks.LootSearchHack lootSearchHack =
new net.wurstclient.hacks.LootSearchHack();
public final net.wurstclient.hacks.LootRunnerHack lootRunnerHack =
new net.wurstclient.hacks.LootRunnerHack();
public final CoordLoggerHack coordLoggerHack = new CoordLoggerHack();
public final TownyHack townyHack = new TownyHack();
private final TreeMap<String, Hack> hax =
new TreeMap<>(String::compareToIgnoreCase);
private final EnabledHacksFile enabledHacksFile;
private final FavoriteHacksFile favoriteHacksFile;
private final Path profilesFolder =
WurstClient.INSTANCE.getWurstFolder().resolve("enabled hacks");
private final EventManager eventManager =
WurstClient.INSTANCE.getEventManager();
public HackList(Path enabledHacksFile, Path favoriteHacksFile)
{
this.enabledHacksFile = new EnabledHacksFile(enabledHacksFile);
this.favoriteHacksFile = new FavoriteHacksFile(favoriteHacksFile);
try
{
for(Field field : HackList.class.getDeclaredFields())
{
if(!field.getName().endsWith("Hack"))
continue;
Hack hack = (Hack)field.get(this);
addHackInternal(hack);
}
// Explicit guard to ensure new hacks remain visible in GUI lists
// even if reflection ordering/name filtering changes.
if(getHackByName(tunnelHoleStairEspHack.getName()) == null)
addHackInternal(tunnelHoleStairEspHack);
}catch(Exception e)
{
String message = "Initializing Wurst hacks";
CrashReport report = CrashReport.forThrowable(e, message);
throw new ReportedException(report);
}
eventManager.add(UpdateListener.class, this);
}
public void addHack(Hack hack)
{
addHackInternal(hack);
}
private void addHackInternal(Hack hack)
{
Objects.requireNonNull(hack, "hack");
String name = hack.getName();
if(hax.containsKey(name))
throw new IllegalArgumentException("Duplicate hack: " + name);
hax.put(name, hack);
}
/**
* Toggle the per-hack "Only above ground" filter for all hacks that
* expose the setting. Useful for binding to a key or calling from the
* command interface.
*/
public void setAboveGroundFilterEnabled(boolean enabled)
{
AboveGroundFilterManager.toggle(this, enabled);
}
/**
* Set the Y threshold used by hacks that expose the above-ground filter.
*/
public void setAboveGroundFilterY(int y)
{
AboveGroundFilterManager.setY(this, y);
}
@Override
public void onUpdate()
{
// Defer loading/enabling hacks until we are in a game world. Loading
// enabled-hacks.json on the title screen can undesirably disable or
// overwrite state triggered from title-screen UI actions. Wait until
// the Minecraft player instance exists.
try
{
net.minecraft.client.Minecraft mc = net.wurstclient.WurstClient.MC;
if(mc == null || mc.player == null)
return;
}catch(Throwable ignored)
{
return;
}
// Preserve runtime HideWurst toggle made on title screen so it isn't
// clobbered by loading saved enabled-hacks.json.
boolean hideWurstWasEnabled = false;
try
{
hideWurstWasEnabled =
this.hideWurstHack != null && this.hideWurstHack.isEnabled();
}catch(Throwable ignored)
{}
enabledHacksFile.load(this);
favoriteHacksFile.load(this);
// If HideWurst was enabled before loading, re-apply it to ensure
// UI/hack rendering remains hidden after entering the world.
try
{
if(hideWurstWasEnabled && this.hideWurstHack != null
&& !this.hideWurstHack.isEnabled())
this.hideWurstHack.setEnabled(true);
}catch(Throwable ignored)
{}
panicHack.handleStartupRestore();
eventManager.remove(UpdateListener.class, this);
}
public void saveEnabledHax()
{
enabledHacksFile.save(this);
}
public void reloadEnabledHax()
{
enabledHacksFile.load(this);
}
public void reloadEnabledHaxDisableOnly()
{
enabledHacksFile.load(this, true);
}
public void saveFavoriteHax()
{
favoriteHacksFile.save(this);
}
public void reloadFavoriteHax()
{
favoriteHacksFile.load(this);
}
public Hack getHackByName(String name)
{
return hax.get(name);
}
public Collection<Hack> getAllHax()
{
return Collections.unmodifiableCollection(hax.values());
}
public int countHax()
{
return hax.size();
}
public ArrayList<Path> listProfiles()
{
if(!Files.isDirectory(profilesFolder))
return new ArrayList<>();
try(Stream<Path> files = Files.list(profilesFolder))
{
return files.filter(Files::isRegularFile)
.collect(Collectors.toCollection(ArrayList::new));
}catch(IOException e)
{
throw new RuntimeException(e);
}
}
public void loadProfile(String fileName) throws IOException, JsonException
{
enabledHacksFile.loadProfile(this, profilesFolder.resolve(fileName));
}
public void saveProfile(String fileName) throws IOException, JsonException
{
enabledHacksFile.saveProfile(this, profilesFolder.resolve(fileName));
}
}