-
Notifications
You must be signed in to change notification settings - Fork 2
/
Bedrock Flattener Mod.js
41 lines (39 loc) · 1.85 KB
/
Bedrock Flattener 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
//Bedrock Flattener Mod
//by wilco375
//Don't share or redistribute this mod using the Github link, instead, use this link: http://adf.ly/qCoxp
var count
function modTick(){
if(count == null){
//clientMessage("count is null")
if(java.io.File(android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/minecraftWorlds/"+Level.getWorldDir()+"/FlatBedrock.info").exists() == false){
//clientMessage(".info doesnt exist")
if( java.io.File(android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/minecraftWorlds/"+Level.getWorldDir()+"/entities.dat").exists()){
//clientMessage("entities.dat exists")
clientMessage(ChatColor.RED+ "[FlatBedrock]" + ChatColor.WHITE + " Now removing all the bedrock. PLEASE DON'T")
clientMessage("TOUCH THE SCREEN DURING THIS PROCESS, IT WILL CRASH YOUR GAME. A message will appear when it's done. It might take 10-20 seconds, depending on your device.")
count = 1
}}}
if( java.io.File(android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/minecraftWorlds/"+Level.getWorldDir()+"/FlatBedrock.info").exists() && count == null){
count = 277
clientMessage(ChatColor.RED+ "[FlatBedrock]" + ChatColor.WHITE + " Bedrock is already successfully flattened out in")
clientMessage("this world!")
}
if(count >= 1 && count <20) count++
if(count >= 20 && count <= 275){
x = count-20
for(var z = 0;z<=255;z++){
for(var y = 1;y<=4;y++){
if(getTile(x,y,z) == 7){
setTile(x,y,z,1)
}
}
}
count++
}
if(count == 276){
clientMessage(ChatColor.RED+ "[FlatBedrock]" + ChatColor.WHITE + " Bedrock successfully flattened out")
var file=new java.io.File(android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/minecraftWorlds/"+Level.getWorldDir()+"/"+"FlatBedrock.info")
file.createNewFile()
count = 277
}
}