-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxaero2voxel.pl
executable file
·73 lines (59 loc) · 1.81 KB
/
xaero2voxel.pl
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
#!/usr/bin/perl
# xaero2voxel.pl - convert xaero waypoints to voxelmap format
#
#
# Input Xareos Folder
$xareosIn = "Multiplayer_servername";
# Output Voxel File
$voxelOut = "servername.points";
open(OF,">$voxelOut") || die "Error creating voxel waypoints ($voxelOut).";
print OF "subworlds:\n";
print OF "oldNorthWorlds:\n";
print OF "seeds:\n";
if (-f "${xareosIn}/overworld/mw65,1,0_1.txt") {
open(IF,"<${xareosIn}/overworld/mw65,1,0_1.txt") || die "error opening overworld file";
while (<IF>) {
chomp();
last if /^$/;
@list = split(':');
$name = $list[1];
$x = $list[3];
$y = $list[4];
$z = $list[5];
print OF "name:", $name, ",x:", $x, ",z:", $z, ",y:", $y,
",enabled:true,red:0.0,green:1.0,blue:0.0,suffix:star,world:,dimensions:overworld#\n";
}
close(IF);
}
if (-f "${xareosIn}/the_nether/mw65,1,0_1.txt") {
open(IF,"<${xareosIn}/the_nether/mw65,1,0_1.txt") || die "error opening nether file";
while (<IF>) {
chomp();
last if /^$/;
@list = split(':');
$name = $list[1];
$x = $list[3];
$y = $list[4];
$z = $list[5];
print OF "name:",$name,",x:",$x,",z:",$z,",y:",$y,
",enabled:true,red:1.0,green:0.0,blue:0.0,suffix:star,world:,dimensions:the_nether#\n";
}
close(IF);
}
if (-f "${xareosIn}/the_end/mw65,1,0_1.txt") {
open(IF,"<${xareosIn}/the_end/mw65,1,0_1.txt") || die "error opening the end file";
while (<IF>) {
chomp();
last if /^$/;
@list = split(':');
$name = $list[1];
$x = $list[3];
$y = $list[4];
$z = $list[5];
print OF "name:",$name,",x:",$x,",z:",$z,",y:",$y,
",enabled:true,red:0.0,green:0.0,blue:1.0,suffix:star,world:,dimensions:the_end#\n";
}
close(IF);
}
close(OF);
exit(0);