-
Notifications
You must be signed in to change notification settings - Fork 9
/
TestScaffold 0.921.js
1023 lines (889 loc) · 38.7 KB
/
TestScaffold 0.921.js
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
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var scriptName = "TestScaffold";
var scriptVersion = 0.9;
var scriptAuthor = "mumy and yby360";
var Color = Java.type("java.awt.Color");
var Integer = Java.type("java.lang.Integer");
var Display = Java.type('org.lwjgl.opengl.Display');
var canPlace = false
var EventState = Java.type("net.ccbluex.liquidbounce.event.EventState");
var Fonts = Java.type("net.ccbluex.liquidbounce.ui.font.Fonts");
var InventoryUtils = Java.type("net.ccbluex.liquidbounce.utils.InventoryUtils");
var MovementUtils = Java.type("net.ccbluex.liquidbounce.utils.MovementUtils");
var PlaceRotation = Java.type("net.ccbluex.liquidbounce.utils.PlaceRotation");
var Rotation = Java.type("net.ccbluex.liquidbounce.utils.Rotation");
var RotationUtils = Java.type("net.ccbluex.liquidbounce.utils.RotationUtils");
var BlockUtils = Java.type("net.ccbluex.liquidbounce.utils.block.BlockUtils");
var PlaceInfo = Java.type("net.ccbluex.liquidbounce.utils.block.PlaceInfo");
var RenderUtils = Java.type("net.ccbluex.liquidbounce.utils.render.RenderUtils");
var MSTimer = Java.type("net.ccbluex.liquidbounce.utils.timer.MSTimer");
var TimeUtils = Java.type("net.ccbluex.liquidbounce.utils.timer.TimeUtils");
var IntegerValue = Java.type("net.ccbluex.liquidbounce.value.IntegerValue");
var MovementUtils = Java.type('net.ccbluex.liquidbounce.utils.MovementUtils');
var RandomUtils=Java.type('net.ccbluex.liquidbounce.utils.misc.RandomUtils');
var Runtime = Java.type("java.lang.Runtime").getRuntime();
var timer = new MSTimer();
var C09PacketHeldItemChange = Java.type("net.minecraft.network.play.client.C09PacketHeldItemChange");
var C0APacketAnimation = Java.type("net.minecraft.network.play.client.C0APacketAnimation");
var C0BPacketEntityAction = Java.type("net.minecraft.network.play.client.C0BPacketEntityAction");
var S12PacketEntityVelocity = Java.type('net.minecraft.network.play.server.S12PacketEntityVelocity');
var S03 = Java.type("net.minecraft.network.play.server.S03PacketTimeUpdate");
var GlStateManager = Java.type("net.minecraft.client.renderer.GlStateManager");
var ScaledResolution = Java.type("net.minecraft.client.gui.ScaledResolution");
var Blocks = Java.type("net.minecraft.init.Blocks");
var ItemBlock = Java.type("net.minecraft.item.ItemBlock");
var GameSettings = Java.type("net.minecraft.client.settings.GameSettings");
var BlockPos = Java.type("net.minecraft.util.BlockPos");
var EnumFacing = Java.type("net.minecraft.util.EnumFacing");
var MathHelper = Java.type("net.minecraft.util.MathHelper");
var Material = Java.type("net.minecraft.block.material.Material");
var MovingObjectPosition = Java.type("net.minecraft.util.MovingObjectPosition");
var EntityItem = Java.type('net.minecraft.entity.item.EntityItem');
var Vec3 = Java.type("net.minecraft.util.Vec3");
var towerModule = moduleManager.getModule("Tower");
var speed = moduleManager.getModule("Speed");
var autowalk = moduleManager.getModule("AutoWalk");
var Strafe = moduleManager.getModule("Strafe");
var scaffoldModule = moduleManager.getModule("TestScaffold");
script.import("lib/minecraftUtils.js");
Math.toDegrees = function (radians) {
return radians / Math.PI * 180;
}
Math.toRadians = function (degrees) {
return degrees / 180 * Math.PI;
}
function TestScaffold() {
var setting = {
float: function (name, def, min, max) {
return value.createFloat(name, def, min, max);
},
integer: function (name, def, min, max) {
return value.createInteger(name, def, min, max);
},
boolean: function (name, def) {
return value.createBoolean(name, def);
},
list: function (name, values, def) {
return value.createList(name, values, def);
}
};
var settings = {
// Mode
mode: setting.list("Mode", ["Normal", "Rewinside", "Expand"], "Normal"),
// Delay
maxDelay: new _AdaptedValue(new (Java.extend(IntegerValue, {
onChanged: function (oldValue, newValue) {
var i = settings.minDelay.get();
if (i > newValue) {
settings.maxDelay.set(i);
}
}
}))("MaxDelay", 0, 0, 1000)),
minDelay: new _AdaptedValue(new (Java.extend(IntegerValue, {
onChanged: function (oldValue, newValue) {
var i = settings.maxDelay.get();
if (i < newValue) {
settings.minDelay.set(i);
}
}
}))("MinDelay", 0, 0, 1000)),
placeableDelay: setting.boolean("PlaceableDelay", false),
// AutoBlock
autoBlock: setting.boolean("AutoBlock", true),
stayAutoBlock: setting.boolean("StayAutoBlock", false),
// Basic stuff
sprint: setting.boolean("Sprint", true),
hirohikosprint: setting.boolean("HirohikoSprint", true),
hypixelsprint: setting.boolean("HypixelSprint", true),
hypixelsprintspeed: setting.float("HypixelSprintSpeed", 1.2, 1, 1.5),
swing: setting.boolean("Swing", true),
search: setting.boolean("Search", true),
down: setting.boolean("Down", true),
placeMode: setting.list("PlaceTiming", ["Pre", "Post"], "Post"),
// Eagle
eagle: setting.boolean("Eagle", false),
eagleSilent: setting.boolean("EagleSilent", false),
blocksToEagle: setting.integer("BlocksToEagle", 0, 0, 10),
// Expand
expandLength: setting.integer("ExpandLength", 5, 1, 6),
// Rotations
rotations: setting.boolean("Rotations", true),
keepLength: setting.integer("KeepRotationLength", 0, 0, 20),
keepRotation: setting.boolean("KeepRotation", false),
rotationYaw: setting.integer("RotationYaw", 0, -90, 90),
// Zitter
zitter: setting.boolean("Zitter", false),
zitterMode: setting.list("ZitterMode", ["Teleport", "Smooth"], "Teleport"),
zitterSpeed: setting.float("ZitterSpeed", 0.13, 0.1, 0.3),
zitterStrength: setting.float("ZitterStrength", 0.072, 0.05, 0.2),
// Game
timer: setting.float("Timer", 1, 0.1, 10),
speedModifier: setting.float("SpeedModifier", 1, 0, 2),
// Safety
antihalf: setting.boolean("AntiHalf", false),
bodyreverser: setting.boolean("BodyReverser", false),
autowalk: setting.boolean("AutoWalk", false),
autowalkmode: setting.list("AutoWalkMode", ["Test", "Bind"], "Test"),
sameY: setting.boolean("SameY", false),
safeWalk: setting.boolean("SafeWalk", true),
airSafe: setting.boolean("AirSafe", false),
buildHand: setting.boolean("BuildHand", false),
tower: setting.boolean("Tower", false),
towermode: setting.list("TowerMode", ["TestTower", "TestTower2", "BindTower", "AACTower"], "TestTower"),
motionground: setting.boolean("MotionGround", false),
speed: setting.boolean("Speed", false),
speedmode: setting.list("SpeedMode", ["AutoJump", "BindSpeed", "TestSpeed", "TestSpeed2", "TestHop", "AACTestSpeed", "AACTestSpeed2", "HClip"], "AutoJump"),
xzrjump: setting.boolean("XZRJump", false),
vclipjump: setting.boolean("VClipJump", false),
vclipjumpset: setting.float("VClipJumpSet", 0.1, 0.01, 1),
randomjump: setting.boolean("RandomJump", false),
fusrodah: setting.boolean("FusRoDah", false),
fusrodahset: setting.float("FusRoDahSet", 0.5, 0.1, 1.5),
// Visuals
counterDisplay: setting.boolean("Counter", true),
fakesprint: setting.boolean("FakeSprint", true),
smoothcamera: setting.boolean("SmoothCamera", true),
skytime: setting.boolean("SkyTime", false),
skyTimeAmount: setting.integer("SkyTimeAmount", 50, -100, 100),
Heartbeat: setting.boolean("HeartBeat", true),
Heartbeatset: setting.integer("HeartBeatSet", 90, 0, 360),
mark: setting.boolean("Mark", false),
markcolorr: setting.integer("MarkColorR", 0, 0, 255),
markcolorg: setting.integer("MarkColorG", 0, 0, 255),
markcolorb: setting.integer("MarkColorB", 0, 0, 255),
markalpha: setting.integer("MarkAlpha", 0, 0, 255),
deathcoords: setting.boolean("DeathCoords", false),
debugcam: setting.boolean("DeBugCam", false),
mousesensitivity: setting.boolean("MouseSensitivity", false),
mousesensitivityset: setting.float("MouseSensitivitySet", 0.5, 0.1, 1.5),
panic: setting.boolean("Panic", false),
memoryback: setting.boolean("MemoryBack", false),
memorybacktime: setting.integer("MemoryBackTime", 3000, 1000, 100000),
betterfps: setting.boolean("BetterFps", false),
title: setting.boolean("Title", false),
debug: setting.boolean("DeBug", false)
};
// Target block
var targetPlace;
// Launch position
var launchY;
// Rotation lock
var lockRotation;
// Auto block slot
var slot;
// Zitter Smooth
var zitterDirection;
// Delay
var delayTimer = new MSTimer();
var zitterTimer = new MSTimer();
var delay;
// Eagle
var placedBlocksWithoutEagle = 0;
var eagleSneaking;
// Down
var shouldGoDown = false;
// RandomJump
function randomIntFrom(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
}
function randomFloatFrom(min,max){
return Math.random()*(max-min)+min;
}
// HirohikoSprint_GetMoveYaw
function getMoveYaw() {
var moveYaw = mc.thePlayer.rotationYaw;
if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing == 0) {
moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
} else if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing != 0) {
if (mc.thePlayer.moveForward > 0)
moveYaw += mc.thePlayer.moveStrafing > 0 ? -45 : 45;
else
moveYaw -= mc.thePlayer.moveStrafing > 0 ? -45 : 45;
moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
} else if (mc.thePlayer.moveStrafing != 0 && mc.thePlayer.moveForward == 0) {
moveYaw += mc.thePlayer.moveStrafing > 0 ? -90 : 90;
}
return moveYaw;
}
this.getName = function () {
return "TestScaffold";
}
this.getDescription = function () {
return "TestScaffold-Module, By yby360 and mumy";
}
this.getCategory = function () {
return "Misc";
}
// BetterFps
this.onPacket = function () {
if (settings.betterfps.get()) {
for (var a in mc.theWorld.loadedEntityList) {
var entities = mc.theWorld.loadedEntityList[a];
if(entities instanceof EntityItem) {
entities.renderDistanceWeight = 0.0;
}
}
}else{
for (var a in mc.theWorld.loadedEntityList) {
var entities = mc.theWorld.loadedEntityList[a];
if(entities instanceof EntityItem) {
entities.renderDistanceWeight = 1.0;
}
}
}
}
// HirohikoSprint_GetOnJump
var stopSprint = false;
var cancel = true;
this.onEnable = function() {
stopSprint = false;
cancel = true
}
this.onJump = function(event) {
if (cancel && mc.thePlayer.isSprinting() && settings.hirohikosprint.get()) {
event.cancelEvent()
cancel = false;
this.yaw = mc.thePlayer.rotationYaw;
mc.thePlayer.rotationYaw = getMoveYaw();
mc.thePlayer.jump();
mc.thePlayer.rotationYaw = this.yaw;
cancel = true;
}
}
this.onEnable = function () {
if (mc.thePlayer == null) {
return;
}
launchY = parseInt(mc.thePlayer.posY);
}
this.onUpdate = function () {
mc.timer.timerSpeed = settings.timer.get();
shouldGoDown = settings.down.get() && GameSettings.isKeyDown(mc.gameSettings.keyBindSneak) && getBlocksAmount() > 1;
if (shouldGoDown) {
mc.gameSettings.keyBindSneak.pressed = false;
}
if (mc.thePlayer.onGround) {
var mode = settings.mode.get();
// Rewinside scaffold mode
if (mode.toLowerCase() === "rewinside") {
MovementUtils.strafe(0.2);
mc.thePlayer.motionY = 0;
}
// Smooth Zitter
if (settings.zitter.get() && settings.zitterMode.get().toLowerCase() === "smooth") {
if (!GameSettings.isKeyDown(mc.gameSettings.keyBindRight)) {
mc.gameSettings.keyBindRight.pressed = false;
}
if (!GameSettings.isKeyDown(mc.gameSettings.keyBindLeft)) {
mc.gameSettings.keyBindLeft.pressed = false;
}
if (zitterTimer.hasTimePassed(100)) {
zitterDirection = !zitterDirection;
zitterTimer.reset();
}
if (zitterDirection) {
mc.gameSettings.keyBindRight.pressed = true;
mc.gameSettings.keyBindLeft.pressed = false;
} else {
mc.gameSettings.keyBindRight.pressed = false;
mc.gameSettings.keyBindLeft.pressed = true;
}
}
// Eagle
if (settings.eagle.get() && !shouldGoDown) {
if (placedBlocksWithoutEagle >= settings.blocksToEagle.get()) {
var shouldEagle = mc.theWorld.getBlockState(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 1, mc.thePlayer.posZ)).getBlock() === Blocks.air;
if (settings.eagleSilent.get()) {
if (eagleSneaking !== shouldEagle) {
mc.getNetHandler().addToSendQueue(
new C0BPacketEntityAction(mc.thePlayer, shouldEagle ?
C0BPacketEntityAction.Action.START_SNEAKING :
C0BPacketEntityAction.Action.STOP_SNEAKING)
);
}
eagleSneaking = shouldEagle;
} else {
mc.gameSettings.keyBindSneak.pressed = shouldEagle;
}
placedBlocksWithoutEagle = 0;
} else {
placedBlocksWithoutEagle++;
}
}
// Zitter
if (settings.zitter.get() && settings.zitterMode.get().toLowerCase() === "teleport") {
MovementUtils.strafe(settings.zitterSpeed.get());
var yaw = Math.toRadians(mc.thePlayer.rotationYaw + (zitterDirection ? 90 : -90));
mc.thePlayer.motionX -= Math.sin(yaw) * settings.zitterStrength.get();
mc.thePlayer.motionZ += Math.cos(yaw) * settings.zitterStrength.get();
zitterDirection = !zitterDirection;
}
} if (settings.sprint.get()) {
mc.thePlayer.setSprinting(true);
}else{
mc.thePlayer.setSprinting(false);
}
}
this.onMotion = function (event) {
var eventState = event.getEventState();
// TestTower
if (settings.tower.get() && settings.towermode.get().toLowerCase() === "testtower") {
ticks = 0; mc.thePlayer.jump();
ticks++;
if (ticks == 9) {
mc.thePlayer.jump();
}
}
// AACTower
if (settings.tower.get() && settings.towermode.get().toLowerCase() === "aactower") {
if (mc.thePlayer.ticksExisted % 4 == 1) {
mc.thePlayer.motionY = 0.4195464;
mc.thePlayer.setPosition(mc.thePlayer.posX - 0.035, mc.thePlayer.posY, mc.thePlayer.posZ);
} else {
if (mc.thePlayer.ticksExisted % 4 == 0) {
mc.thePlayer.motionY = -0.5;
mc.thePlayer.setPosition(mc.thePlayer.posX + 0.035, mc.thePlayer.posY, mc.thePlayer.posZ);
}
}
}
// TestTower2
if (settings.tower.get() && settings.towermode.get().toLowerCase() === "testtower2") {
mc.thePlayer.speedInAir = 0.03;
mc.thePlayer.jumpMovementFactor = 0.016;
mc.timer.timerSpeed = 0.6;
if (mc.thePlayer.onGround = true) {
mc.thePlayer.jump();
}
}
// AutoJump
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "autojump") {
mc.thePlayer.onGround && mc.thePlayer.jump();
}
// FusRoDah
if (settings.fusrodah.get()) {
if(mc.thePlayer.hurtTime > 0) {
mc.thePlayer.motionX *= settings.fusrodahset.get();
mc.thePlayer.motionZ *= settings.fusrodahset.get();
mc.thePlayer.motionY *= settings.fusrodahset.get();
}
}
// RandomJump
if (settings.randomjump.get() && mc.thePlayer.onGround) {
mc.thePlayer.motionY+=randomFloatFrom(0.01,0.84);
}
// DebugCam
if (settings.debugcam.get()) {
mc.gameSettings.debugCamEnable=true;
}else{
mc.gameSettings.debugCamEnable=false;
}
// Title
if (settings.title.get()) {
Display.setTitle('丨TestScaffold | Developer Build Mode丨欢迎使用捏');
}else{
Display.setTitle('丨TestScaffold | Developer Build Mode丨你小子还想关我?');
}
// MouseSensitivity
if (settings.mousesensitivity.get()) {
mc.gameSettings.mouseSensitivity=settings.mousesensitivityset.get();
}else{
mc.gameSettings.mouseSensitivity=0.55;
}
// MemoryBack
if (settings.memoryback.get()) {
timer.hasTimePassed(settings.memorybacktime.get()) && (Runtime.gc(), timer.reset());
}
// HirohikoSprint
if (mc.thePlayer.isSprinting() && settings.hirohikosprint.get()) {
if (mc.thePlayer.moveForward <= 0) {
mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
stopSprint = true;
} else if (stopSprint) {
mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING));
stopSprint = false;
}
} else {
stopSprint = false;
}
// DeathCoords
var sentMessage = false;
if (settings.deathcoords.get()) {
if (mc.thePlayer.getHealth() <= 0) {
if (!sentMessage) {
var posX = mc.thePlayer.posX.toFixed(0);
var posY = mc.thePlayer.posY.toFixed(0);
var posZ = mc.thePlayer.posZ.toFixed(0);
var coords = posX + "/" + posY + "/" + posZ;
Chat.print("§8[§9DeathCoords§8] §f" + coords);
sentMessage = true;
}
} else {
sentMessage = false;
}
}
// BodyReverser
if (settings.bodyreverser.get() && mc.gameSettings.keyBindForward.pressed && !settings.autowalk.get()) {
mc.gameSettings.keyBindBack.pressed = true;
mc.gameSettings.keyBindForward.pressed = false;
mc.thePlayer.rotationYaw += 180
}
// HypixelSprint
if (settings.hypixelsprint.get()) {
if (mc.gameSettings.keyBindForward.isKeyDown() && !mc.thePlayer.isSneaking()) {
mc.thePlayer.motionX *= settings.hypixelsprintspeed.get()
mc.thePlayer.motionZ *= settings.hypixelsprintspeed.get()
}else{
}
}
// HClip
ticks++
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "hclip") {
if (mc.gameSettings.keyBindForward.isKeyDown() && !mc.thePlayer.isSneaking()) {
mc.thePlayer.setSprinting(true);
if(mc.thePlayer.onGround) {
mc.thePlayer.jump();
}
if(ticks == 2 || ticks == 4 || ticks == 6 || ticks ==8 || ticks == 12 || ticks == 16 || ticks == 18 || ticks == 20) {
hClip(1)
mc.thePlayer.motionX = 0;
mc.thePlayer.motionZ = 0;
}else {
}
} else {
mc.thePlayer.speedInAir = 0.025;
}
if(ticks == 20) {
ticks = 0;
}
}
// SkyTime
if (settings.skytime.get()) {
mc.theWorld.setWorldTime(mc.theWorld.getWorldTime() + settings.skyTimeAmount.get())
}
// AntiHalf
if (settings.antihalf.get()) {
if (mc.thePlayer.onGround && mc.theWorld.getBlockState(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)).getBlock() instanceof SlabBlock) {
mc.gameSettings.keyBindJump.pressed = true;
}
}
// XZRJump
if (settings.xzrjump.get()) {
mc.thePlayer.motionX = mc.thePlayer.motionZ = 0;
}
// VClipJump
if (settings.vclipjump.get()) {
JumpCalnceler = true, mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY += settings.vclipjumpset.get(), mc.thePlayer.posZ);
}
// TestAutoWalk
if (settings.autowalk.get() && settings.autowalkmode.get().toLowerCase() === "test") {
mc.gameSettings.keyBindForward.pressed = true;
}
// BindAutoWalk
if (settings.autowalk.get() && settings.autowalkmode.get().toLowerCase() === "bind") {
autowalk.setState(true)
}else{
autowalk.setState(false)
}
// BindSpeed
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "bindspeed") {
speed.setState(true)
}else{
speed.setState(false)
}
// AACTestSpeed
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "aactestspeed") {
if(mc.thePlayer.moveForward>0){
if(mc.thePlayer.onGround){mc.thePlayer.jump();
mc.timer.timerSpeed=1.6105;
mc.thePlayer.motionX*=1.0708;
mc.thePlayer.motionZ*=1.0708;
}else if(mc.thePlayer.fallDistance>0){
mc.timer.timerSpeed=0.6;
}
}
}
// AACTestSpeed2
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "aactestspeed2") {
if (mc.gameSettings.keyBindForward.isKeyDown() && !mc.thePlayer.isSneaking()) {
mc.thePlayer.setSprinting(true);
if (mc.thePlayer.onGround){
if(!mc.gameSettings.keyBindJump.isKeyDown()){
mc.thePlayer.jump()
}
mc.thePlayer.motionZ *= 1.01;
mc.thePlayer.motionX *= 1.01;
}
mc.thePlayer.motionY -= 0.014;
}
}
// TestHop
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "testhop") {
if(mc.gameSettings.keyBindForward.isKeyDown() || mc.gameSettings.keyBindLeft.isKeyDown() || mc.gameSettings.keyBindRight.isKeyDown() || mc.gameSettings.keyBindBack.isKeyDown()) {
mc.thePlayer.motionX *= 1.05;
mc.thePlayer.motionZ *= 1.05;
Strafe.setState(true);
mc.timer.timerSpeed = 1.11
if (mc.thePlayer.onGround) {
mc.thePlayer.jump();
mc.timer.timerSpeed = 1.11;
}
} else {
Strafe.setState(false);
mc.thePlayer.motionX = 0.0;
mc.thePlayer.motionZ = 0.0;
mc.timer.timerSpeed = 1.0;
}
}
// TestSpeed2
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "testspeed2") {
if (mc.thePlayer.onGround) {
mc.gameSettings.keyBindJump.pressed = false;
mc.thePlayer.jump();
}
if (!mc.thePlayer.onGround && mc.thePlayer.fallDistance <= 0.1) {
mc.thePlayer.speedInAir = 0.02;
mc.timer.timerSpeed = 1.5;
}
if (mc.thePlayer.fallDistance > 0.1 && mc.thePlayer.fallDistance < 1.3) {
mc.thePlayer.speedInAir = 0.0205;
mc.timer.timerSpeed = 0.7;
}
if (mc.thePlayer.fallDistance >= 1.3) {
mc.timer.timerSpeed = 1;
mc.thePlayer.speedInAir = 0.02;
}
}
// TestSpeed
if (settings.speed.get() && settings.speedmode.get().toLowerCase() === "testspeed") {
if(mc.thePlayer.onGround) mc.timer.timerSpeed =1.0;
if(mc.thePlayer.onGround && MovementUtils.isMoving()) {
mc.thePlayer.jump();
mc.timer.timerSpeed =1.0;
mc.thePlayer.motionY = 0.419973;
};
if(mc.thePlayer.motionY>0 && !mc.thePlayer.onGround) {
mc.thePlayer.motionY -= 0.0007991;
mc.thePlayer.jumpMovementFactor=0.0201465;
mc.timer.timerSpeed =1.15;
}else{
mc.thePlayer.motionY -= 0.00074775;
mc.thePlayer.jumpMovementFactor=0.0201519;
mc.timer.timerSpeed =0.80;
};
if(mc.thePlayer.fallDistance>2) mc.timer.timerSpeed =1.0;
if(!mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0,0.201,0).expand(0,0,0)).isEmpty()) {
if(mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0,0.199,0).expand(0,0,0)).isEmpty()) {
if(mc.thePlayer.onGround) mc.timer.timerSpeed = 2;
}
}
}
// FakeSprint
if (settings.fakesprint.get()) {
mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0000013, mc.thePlayer.posZ);
mc.thePlayer.setSprinting(true);
}
// SmoothCamera
if (settings.smoothcamera.get()) {
mc.gameSettings.smoothCamera = true;
}else{
mc.gameSettings.smoothCamera = false;
}
// Heartbeat
var ticks = 0;
if (settings.Heartbeat.get()) {
mc.gameSettings.fovSetting = settings.Heartbeatset.get();
}else{
mc.gameSettings.fovSetting = 90;
}
// Panic
if (settings.panic.get()) {
chat.print("If you need to open TestScaffold, please close the panic first");
commandManager.executeCommand(".panic all");
}
//MotionGround
if (settings.motionground.get()) {
mc.thePlayer.onGround = 2.5;
mc.thePlayer.motionY = 0;
}
// Debug
if (settings.debug.get()) {
chat.print("§8[§9§lDebug§8] RotationYaw:" + mc.thePlayer.rotationYaw + " | RotationPitch:" + mc.thePlayer.rotationPitch);
}
//RotationYaw
RotationUtils.setTargetRotation(new Rotation(mc.thePlayer.rotationYaw,settings.rotationYaw.get()))
// BuildHand
if (settings.buildHand.get()) {
mc.rightClickDelayTimer = 4;
var itemStack = mc.thePlayer.inventory.getCurrentItem();
var blockPos = mc.objectMouseOver.getBlockPos();
var placeSide = mc.objectMouseOver.sideHit.getOpposite();
var hitVec = mc.objectMouseOver.hitVec;
if (mc.theWorld.getBlockState(blockPos).getBlock().getMaterial() != Material.air) {
while (true) {
if (!isBlockInReach(mc.thePlayer, blockPos)) {
break;
};
if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, itemStack, blockPos, placeSide, hitVec)) {
mc.thePlayer.swingItem();
break;
};
blockPos = blockPos.add(placeSide.getDirectionVec());
};
};
};
// Lock Rotation
if (settings.rotations.get() && settings.keepRotation.get() && lockRotation != null) {
RotationUtils.setTargetRotation(lockRotation);
}
// Place block
if (settings.placeMode.get().toLowerCase() === eventState.getStateName().toLowerCase()) {
place();
}
// Update and search for new block
if (eventState === EventState.PRE) {
update();
}
// Reset placeable delay
if (targetPlace == null && settings.placeableDelay.get()) {
delayTimer.reset();
}
}
function update() {
var isHeldItemBlock = mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock;
if (settings.autoBlock.get() ? InventoryUtils.findAutoBlockBlock() === -1 && !isHeldItemBlock : !isHeldItemBlock) {
return;
}
findBlock(settings.mode.get().toLowerCase() === "expand");
//BindTower
if (settings.tower.get() && settings.towermode.get().toLowerCase() === "bindtower") {
if (mc.gameSettings.keyBindJump.isKeyDown() && !mc.gameSettings.keyBindLeft.isKeyDown() && !mc.gameSettings.keyBindRight.isKeyDown() && !mc.gameSettings.keyBindForward.isKeyDown() && !mc.gameSettings.keyBindBack.isKeyDown()) {
mc.thePlayer.motionX = 0;
mc.thePlayer.motionZ = 0;
mc.thePlayer.jumpMovementFactor = 0;
mc.thePlayer.onGround = false;
towerModule.setState(true)
scaffoldModule.setState(false)
}else{
towerModule.setState(false)
scaffoldModule.setState(true)
}
}
}
function findBlock(expand) {
var blockPosition = shouldGoDown ?
(mc.thePlayer.posY === parseInt(mc.thePlayer.posY) + 0.5 ?
new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 0.6, mc.thePlayer.posZ) :
new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 0.6, mc.thePlayer.posZ).down()) :
(mc.thePlayer.posY === parseInt(mc.thePlayer.posY) + 0.5 ?
new BlockPos(mc.thePlayer) :
new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ).down());
if (!expand && (!BlockUtils.isReplaceable(blockPosition) || search(blockPosition, !shouldGoDown))) {
return;
}
if (expand) {
for (var i = 0; i < settings.expandLength.get(); i++) {
if (search(blockPosition.add(
Integer.valueOf(mc.thePlayer.getHorizontalFacing() === EnumFacing.WEST ? -i : mc.thePlayer.getHorizontalFacing() === EnumFacing.EAST ? i : 0).intValue(),
Integer.valueOf(0).intValue(),
Integer.valueOf(mc.thePlayer.getHorizontalFacing() === EnumFacing.NORTH ? -i : mc.thePlayer.getHorizontalFacing() === EnumFacing.SOUTH ? i : 0).intValue()
), false)) {
return;
}
}
} else if (settings.search.get()) {
for (var x = -1; x <= 1; x++) {
for (var z = -1; z <= 1; z++) {
if (search(blockPosition.add(Integer.valueOf(x).intValue(), Integer.valueOf(0).intValue(), Integer.valueOf(z).intValue()), !shouldGoDown)) {
return;
}
}
}
}
}
function place() {
if (targetPlace == null) {
if (settings.placeableDelay.get()) {
delayTimer.reset();
}
return;
}
if (!delayTimer.hasTimePassed(delay) || (settings.sameY.get() && launchY - 1 !== parseInt(targetPlace.getVec3().yCoord))) {
return;
}
var blockSlot = -1;
var itemStack = mc.thePlayer.getHeldItem();
if (mc.thePlayer.getHeldItem() == null || !(mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock) || mc.thePlayer.getHeldItem().stackSize <= 0) {
if (!settings.autoBlock.get()) {
return;
}
blockSlot = InventoryUtils.findAutoBlockBlock();
if (blockSlot === -1) {
return;
}
mc.getNetHandler().addToSendQueue(new C09PacketHeldItemChange(blockSlot - 36));
itemStack = mc.thePlayer.inventoryContainer.getSlot(blockSlot).getStack();
}
if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, itemStack, targetPlace.getBlockPos(), targetPlace.getEnumFacing(), targetPlace.getVec3())) {
delayTimer.reset();
delay = TimeUtils.randomDelay(settings.minDelay.get(), settings.maxDelay.get());
if (mc.thePlayer.onGround) {
var modifier = settings.speedModifier.get();
mc.thePlayer.motionX *= modifier;
mc.thePlayer.motionZ *= modifier;
}
if (settings.swing.get()) {
mc.thePlayer.swingItem();
} else {
mc.getNetHandler().addToSendQueue(new C0APacketAnimation());
}
}
if (!settings.stayAutoBlock.get() && blockSlot >= 0) {
mc.getNetHandler().addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
}
// Reset
targetPlace = null;
}
this.onDisable = function () {
if (mc.thePlayer == null) {
return;
}
if (!GameSettings.isKeyDown(mc.gameSettings.keyBindSneak)) {
mc.gameSettings.keyBindSneak.pressed = false;
if (eagleSneaking) {
mc.getNetHandler().addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
}
}
if (!GameSettings.isKeyDown(mc.gameSettings.keyBindRight)) {
mc.gameSettings.keyBindRight.pressed = false;
}
if (!GameSettings.isKeyDown(mc.gameSettings.keyBindLeft)) {
mc.gameSettings.keyBindLeft.pressed = false;
}
lockRotation = null;
mc.timer.timerSpeed = 1;
shouldGoDown = false;
if (slot !== mc.thePlayer.inventory.currentItem) {
mc.getNetHandler().addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
}
}
this.onMove = function (event) {
if (!settings.safeWalk.get() || shouldGoDown) {
return;
}
if (settings.airSafe.get() || mc.thePlayer.onGround) {
event.setSafeWalk(true);
}
}
this.onRender2D = function (event) {
if (settings.counterDisplay.get()) {
GlStateManager.pushMatrix();
var blockOverlay = moduleManager.getModule("BlockOverlay");
if (blockOverlay.getState() && blockOverlay.getInfoValue().get() && blockOverlay.getCurrentBlock() != null) {
GlStateManager.translate(0, 15, 0);
}
var info = "Blocks: §7" + getBlocksAmount();
var scaledResolution = new ScaledResolution(mc);
RenderUtils.drawBorderedRect(
(scaledResolution.getScaledWidth() / 2) - 2,
(scaledResolution.getScaledHeight() / 2) + 5,
(scaledResolution.getScaledWidth() / 2) + Fonts.font40.getStringWidth(info) + 2,
(scaledResolution.getScaledHeight() / 2) + 16, 3, Color.BLACK.getRGB(), Color.BLACK.getRGB());
GlStateManager.resetColor();
Fonts.font40.drawString(info, scaledResolution.getScaledWidth() / 2,
scaledResolution.getScaledHeight() / 2 + 7, Color.WHITE.getRGB());
GlStateManager.popMatrix();
}
}
this.onRender3D = function (event) {
if (!settings.mark.get()) {
return;
}
for (var i = 0; i < (settings.mode.get().toLowerCase() === "expand" ? settings.expandLength.get() + 1 : 2); i++) {
var blockPos = new BlockPos(mc.thePlayer.posX + (mc.thePlayer.getHorizontalFacing() === EnumFacing.WEST ? -i : mc.thePlayer.getHorizontalFacing() === EnumFacing.EAST ? i : 0), mc.thePlayer.posY - (mc.thePlayer.posY === parseInt(mc.thePlayer.posY) + 0.5 ? 0 : 1.0) - (shouldGoDown ? 1 : 0), mc.thePlayer.posZ + (mc.thePlayer.getHorizontalFacing() === EnumFacing.NORTH ? -i : mc.thePlayer.getHorizontalFacing() === EnumFacing.SOUTH ? i : 0));
var placeInfo = PlaceInfo.get(blockPos);
if (BlockUtils.isReplaceable(blockPos) && placeInfo != null) {
RenderUtils.drawBlockBox(blockPos, new Color(settings.markcolorr.get(),settings.markcolorg.get(),settings.markcolorb.get(), settings.markalpha.get()), false);
break;
}
}
}
function search(blockPosition, checks) {
if (!BlockUtils.isReplaceable(blockPosition)) {
return false;
}
var eyesPos = new Vec3(mc.thePlayer.posX, mc.thePlayer.getEntityBoundingBox().minY + mc.thePlayer.getEyeHeight(), mc.thePlayer.posZ);
var placeRotation = null;
var values = EnumFacing.values();
for (var i = 0; i < values.length; ++i) {
var side = values[i];
var neighbor = blockPosition.offset(side);
if (!BlockUtils.canBeClicked(neighbor)) {
continue;
}
var dirVec = new Vec3(side.getDirectionVec());
for (var xSearch = 0.1; xSearch < 0.9; xSearch += 0.1) {
for (var ySearch = 0.1; ySearch < 0.9; ySearch += 0.1) {
for (var zSearch = 0.1; zSearch < 0.9; zSearch += 0.1) {
var posVec = (new Vec3(blockPosition)).addVector(xSearch, ySearch, zSearch);
var distanceSqPosVec = eyesPos.squareDistanceTo(posVec);
var hitVec = posVec.add(new Vec3(dirVec.xCoord * 0.5, dirVec.yCoord * 0.5, dirVec.zCoord * 0.5));
if (checks && (eyesPos.squareDistanceTo(hitVec) > 18 || distanceSqPosVec > eyesPos.squareDistanceTo(posVec.add(dirVec)) || mc.theWorld.rayTraceBlocks(eyesPos, hitVec, false, true, false) != null)) {
continue;
}
// face block
var diffX = hitVec.xCoord - eyesPos.xCoord;
var diffY = hitVec.yCoord - eyesPos.yCoord;
var diffZ = hitVec.zCoord - eyesPos.zCoord;
var diffXZ = MathHelper.sqrt_double(diffX * diffX + diffZ * diffZ);
var rotation = new Rotation(
MathHelper.wrapAngleTo180_float(Math.toDegrees(Math.atan2(diffZ, diffX)) - 90),
MathHelper.wrapAngleTo180_float(-Math.toDegrees(Math.atan2(diffY, diffXZ)))
);
var rotationVector = RotationUtils.getVectorForRotation(rotation);
var vector = eyesPos.addVector(rotationVector.xCoord * 4, rotationVector.yCoord * 4, rotationVector.zCoord * 4);
var obj = mc.theWorld.rayTraceBlocks(eyesPos, vector, false, false, true);
if (!(obj.typeOfHit === MovingObjectPosition.MovingObjectType.BLOCK && obj.getBlockPos().equals(neighbor))) {
continue;
}
if (placeRotation == null || RotationUtils.getRotationDifference(rotation) < RotationUtils.getRotationDifference(placeRotation.getRotation())) {
placeRotation = new PlaceRotation(new PlaceInfo(neighbor, side.getOpposite(), hitVec), rotation);
}
}
}
}
}
if (placeRotation == null) {
return false;
}
if (settings.rotations.get()) {
RotationUtils.setTargetRotation(placeRotation.getRotation(), settings.keepLength.get());
lockRotation = placeRotation.getRotation();
}
targetPlace = placeRotation.getPlaceInfo();
return true;
}
function getBlocksAmount() {
var amount = 0;
for (var i = 36; i < 45; i++) {
var itemStack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
if (itemStack != null && itemStack.getItem() instanceof ItemBlock) {
var block = itemStack.getItem().getBlock();
if (mc.thePlayer.getHeldItem() === itemStack || !InventoryUtils.BLOCK_BLACKLIST.contains(block)) {
amount += itemStack.stackSize;
}
}