-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSpeedMine.js
143 lines (135 loc) · 5.3 KB
/
SpeedMine.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
/// api_version=2
var script = registerScript({
name: 'FastMine',
version: '1.0',
authors: ['Killer']
});
var C07PacketPlayerDigging = Java.type('net.minecraft.network.play.client.C07PacketPlayerDigging')
var PotionEffect = Java.type('net.minecraft.potion.PotionEffect')
var EnumFacing = Java.type('net.minecraft.util.EnumFacing')
var ItemTool = Java.type('net.minecraft.item.ItemTool')
var BlockPos = Java.type('net.minecraft.util.BlockPos')
var Potion = Java.type('net.minecraft.potion.Potion')
var Blocks = Java.type('net.minecraft.init.Blocks')
var Block = Java.type('net.minecraft.block.Block')
function getBlock(x, y, z) {
var pos = new BlockPos(x, y, z);
return mc.theWorld.getChunkFromBlockCoords(pos).getBlock(pos);
}
function getBlockPos() {
return BlockPos
}
script.on('enable', function () {});
script.on('disable', function () {});
script.on('load', function () {});
script.registerModule({
name: 'FastMine',
description: 'Speeds up block breaking',
category: 'Player',
tag: 'BigGod',
settings: {
Mode: Setting.list({
name: 'Mode',
values: ['NewPacket', 'NewPacket2', 'Potion', 'Novoline', 'Remix', 'Autumm'],
default: 'NewPacket'
}),
Time: Setting.integer({
name: 'Time',
default: 10,
min: 0,
max: 200
}),
Level: Setting.integer({
name: 'Level',
default: 3,
min: 0,
max: 4
}),
MineSpeed: Setting.float({
name: 'Speed',
default: 1.4,
min: 0.0,
max: 3.0
}),
}
}, function (module) {
module.on('disable', function () {
if(Mode.get() == 'Potion') {
mc.thePlayer.removePotionEffect(Potion.digSpeed.getId())
}
});
module.on('packet', function (event) {
var bzs = false; var bzx = 0.0; var pos; var face;
if(Mode.get() == 'Remix') {
if(event.getPacket() instanceof C07PacketPlayerDigging && mc.playerController != null) {
if(event.getPacket().getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
bzs = true
pos = event.getPacket().getPosition()
face = event.getPacket().getFacing()
bzx = 0.0
} else if(event.getPacket().getStatus() == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK || event.getPacket().getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) {
bzs = false
pos = null
face = null
}
}
}
});
module.on('update', function () {
mc.playerController.blockHitDelay = 0
if(Mode.get() == 'NewPacket') {
if(mc.playerController.curBlockDamageMP == 0.1) {
mc.playerController.curBlockDamageMP += 0.1
}
if(mc.playerController.curBlockDamageMP == 0.4) {
mc.playerController.curBlockDamageMP += 0.1
}
if(mc.playerController.curBlockDamageMP == 0.7) {
mc.playerController.curBlockDamageMP += 0.1
}
}
if(Mode.get() == 'NewPacket2') {
if(mc.playerController.curBlockDamageMP == 0.2) {
mc.playerController.curBlockDamageMP += 0.1
}
if(mc.playerController.curBlockDamageMP == 0.4) {
mc.playerController.curBlockDamageMP += 0.1
}
if(mc.playerController.curBlockDamageMP == 0.6) {
mc.playerController.curBlockDamageMP += 0.1
}
if(mc.playerController.curBlockDamageMP == 0.8) {
mc.playerController.curBlockDamageMP += 0.2
}
}
if(Mode.get() == 'Potion') {
mc.thePlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Time.get(), Level.get()))
}
if(Mode.get() == 'Novoline') {
if(mc.theWorld != null) {
if(mc.playerController.curBlockDamageMP > (mc.thePlayer.inventory() && mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemTool ? 0.6:0.675)) {
mc.playerController.curBlockDamageMP = 1.0
}
}
}
if(Mode.get() == 'Remix') {
if(mc.playerController.extendedReach()) {
mc.playerController.blockHitDelay = 0
} else if(bzs) {
var block = mc.theWorld.getBlockState(pos).getBlock()
bzx += (block.getPlayerRelativeBlockHardness(mc.thePlayer, mc.theWorld, pos) * MineSpeed.get())
if (bzx >= 1.0) {
mc.theWorld.setBlockState(pos, Blocks.air.getDefaultState(), 11)
mc.thePlayer.sendQueue.getNetworkManager().sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, face))
bzx = 0.0
bzs = false
}
}
}
if(Mode.get() == 'Autumm') {
var pos = getBlockPos()
mc.playerController.curBlockDamageMP += getBlock(pos.getX(), pos.getY(), pos.getZ())
mc.theWorld.getBlockState(pos).getBlock().getPlayerRelativeBlockHardness(mc.thePlayer, mc.theWorld, pos) * 0.186
}
});
});