Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3import java.io.File;
4import java.util.regex.Matcher;
5
6class ChunkFile implements Comparable {
7
8 private final File a;
9 private final int b;
10 private final int c;
11
12 public ChunkFile(File file1) {
13 this.a = file1;
14 Matcher matcher = ChunkFilenameFilter.a.matcher(file1.getName());
15
16 if (matcher.matches()) {
17 this.b = Integer.parseInt(matcher.group(1), 36);
18 this.c = Integer.parseInt(matcher.group(2), 36);
19 } else {
20 this.b = 0;
21 this.c = 0;
22 }
23 }
24
25 public int compareTo(Object o) {
26 ChunkFile chunkfile = (ChunkFile) o;
27 int i = this.b >> 5;
28 int j = chunkfile.b >> 5;
29
30 if (i == j) {
31 int k = this.c >> 5;
32 int l = chunkfile.c >> 5;
33
34 return k - l;
35 } else {
36 return i - j;
37 }
38 }
39
40 public File a() {
41 return this.a;
42 }
43
44 public int b() {
45 return this.b;
46 }
47
48 public int c() {
49 return this.c;
50 }
51}