-
Notifications
You must be signed in to change notification settings - Fork 2
/
Exploding Ores Mod.js
68 lines (54 loc) · 1.63 KB
/
Exploding Ores Mod.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
//Exploding Ores Mod
//by wilco375
//Don't share or redistribute this mod using the Github link, instead, use this link: http://adf.ly/p2m3V
var explodingChancePercentageIron = 20
var explodingChancePercentageGold = 20
var explodingChancePercentageDiamond = 20
var explodingChancePercentageRedstone = 20
var explodingChancePercentageLapis = 20
var explodingChancePercentageCoal = 20
var explodingRadiusIron = 4
var explodingRadiusGold = 4
var explodingRadiusDiamond = 4
var explodingRadiusRedstone = 4
var explodingRadiusLapis = 4
var explodingRadiusCoal = 4
var cI = Math.pow(explodingChancePercentageIron/100, -1)
var cG = Math.pow(explodingChancePercentageGold/100, -1)
var cD = Math.pow(explodingChancePercentageDiamond/100, -1)
var cL = Math.pow(explodingChancePercentageLapis/100, -1)
var cR = Math.pow(explodingChancePercentageRedstone/100, -1)
var cC = Math.pow(explodingChancePercentageCoal/100, -1)
function destroyBlock(x,y,z,shouldDrop){
b = getTile(x,y,z)
if(b == 15){
e = Math.floor((Math.random() * cI) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusIron)
}}
if(b == 16){
e = Math.floor((Math.random() * cC) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusCoal)
}}
if(b == 21){
e = Math.floor((Math.random() * cL) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusLapis)
}}
if(b == 56){
e = Math.floor((Math.random() * cD) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusDiamond)
}}
if(b == 73 || b == 74){
e = Math.floor((Math.random() * cR) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusRedstone)
}}
if(b == 14){
e = Math.floor((Math.random() * cG) + 1)
if(e == 1){
Level.explode(x,y,z,explodingRadiusGold)
}}
}