/
TileEntityMobSpawnerData.java
72 lines (59 loc) · 2.05 KB
/
TileEntityMobSpawnerData.java
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
package net.minecraft.server;
public class TileEntityMobSpawnerData extends WeightedRandomChoice {
public final NBTTagCompound b;
public final String c;
final MobSpawnerAbstract d;
public TileEntityMobSpawnerData(MobSpawnerAbstract mobspawnerabstract, NBTTagCompound nbttagcompound) {
super(nbttagcompound.getInt("Weight"));
this.d = mobspawnerabstract;
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Properties");
String s = nbttagcompound.getString("Type");
if (s.equals("Minecart")) {
if (nbttagcompound1 != null) {
switch (nbttagcompound1.getInt("Type")) {
case 0:
s = "MinecartRideable";
break;
case 1:
s = "MinecartChest";
break;
case 2:
s = "MinecartFurnace";
}
} else {
s = "MinecartRideable";
}
}
this.b = nbttagcompound1;
this.c = s;
}
public TileEntityMobSpawnerData(MobSpawnerAbstract mobspawnerabstract, NBTTagCompound nbttagcompound, String s) {
super(1);
this.d = mobspawnerabstract;
if (s.equals("Minecart")) {
if (nbttagcompound != null) {
switch (nbttagcompound.getInt("Type")) {
case 0:
s = "MinecartRideable";
break;
case 1:
s = "MinecartChest";
break;
case 2:
s = "MinecartFurnace";
}
} else {
s = "MinecartRideable";
}
}
this.b = nbttagcompound;
this.c = s;
}
public NBTTagCompound a() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.set("Properties", this.b);
nbttagcompound.setString("Type", this.c);
nbttagcompound.setInt("Weight", this.a);
return nbttagcompound;
}
}