Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 203 lines 4.9 kB view raw
1package net.minecraft.server; 2 3import java.util.List; 4 5import uk.betacraft.uberbukkit.Uberbukkit; 6 7public class WorldData { 8 9 private long a; 10 private int b; 11 private int c; 12 private int d; 13 private long e; 14 private long f; 15 private long g; 16 private NBTTagCompound h; 17 private int i; 18 public String name; // CraftBukkit - private -> public 19 private int k; 20 private boolean l; 21 private int m; 22 private boolean n; 23 private int o; 24 25 public WorldData(NBTTagCompound nbttagcompound) { 26 this.a = nbttagcompound.getLong("RandomSeed"); 27 this.b = nbttagcompound.e("SpawnX"); 28 this.c = nbttagcompound.e("SpawnY"); 29 this.d = nbttagcompound.e("SpawnZ"); 30 this.e = nbttagcompound.getLong("Time"); 31 this.f = nbttagcompound.getLong("LastPlayed"); 32 this.g = nbttagcompound.getLong("SizeOnDisk"); 33 this.name = nbttagcompound.getString("LevelName"); 34 this.k = nbttagcompound.e("version"); 35 this.m = nbttagcompound.e("rainTime"); 36 this.l = nbttagcompound.m("raining"); 37 this.o = nbttagcompound.e("thunderTime"); 38 this.n = nbttagcompound.m("thundering"); 39 if (nbttagcompound.hasKey("Player")) { 40 this.h = nbttagcompound.k("Player"); 41 this.i = this.h.e("Dimension"); 42 } 43 } 44 45 public WorldData(long i, String s) { 46 this.a = i; 47 this.name = s; 48 } 49 50 public WorldData(WorldData worlddata) { 51 this.a = worlddata.a; 52 this.b = worlddata.b; 53 this.c = worlddata.c; 54 this.d = worlddata.d; 55 this.e = worlddata.e; 56 this.f = worlddata.f; 57 this.g = worlddata.g; 58 this.h = worlddata.h; 59 this.i = worlddata.i; 60 this.name = worlddata.name; 61 this.k = worlddata.k; 62 this.m = worlddata.m; 63 this.l = worlddata.l; 64 this.o = worlddata.o; 65 this.n = worlddata.n; 66 } 67 68 public NBTTagCompound a() { 69 NBTTagCompound nbttagcompound = new NBTTagCompound(); 70 71 this.a(nbttagcompound, this.h); 72 return nbttagcompound; 73 } 74 75 public NBTTagCompound a(List list) { 76 NBTTagCompound nbttagcompound = new NBTTagCompound(); 77 EntityHuman entityhuman = null; 78 NBTTagCompound nbttagcompound1 = null; 79 80 if (list.size() > 0) { 81 entityhuman = (EntityHuman) list.get(0); 82 } 83 84 if (entityhuman != null) { 85 nbttagcompound1 = new NBTTagCompound(); 86 entityhuman.d(nbttagcompound1); 87 } 88 89 this.a(nbttagcompound, nbttagcompound1); 90 return nbttagcompound; 91 } 92 93 private void a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1) { 94 nbttagcompound.setLong("RandomSeed", this.a); 95 nbttagcompound.a("SpawnX", this.b); 96 nbttagcompound.a("SpawnY", this.c); 97 nbttagcompound.a("SpawnZ", this.d); 98 nbttagcompound.setLong("Time", this.e); 99 nbttagcompound.setLong("SizeOnDisk", this.g); 100 nbttagcompound.setLong("LastPlayed", System.currentTimeMillis()); 101 nbttagcompound.setString("LevelName", this.name); 102 nbttagcompound.a("version", this.k); 103 nbttagcompound.a("rainTime", this.m); 104 nbttagcompound.a("raining", this.l); 105 nbttagcompound.a("thunderTime", this.o); 106 nbttagcompound.a("thundering", this.n); 107 if (nbttagcompound1 != null) { 108 nbttagcompound.a("Player", nbttagcompound1); 109 } 110 } 111 112 public long getSeed() { 113 return this.a; 114 } 115 116 public int c() { 117 return this.b; 118 } 119 120 public int d() { 121 return this.c; 122 } 123 124 public int e() { 125 return this.d; 126 } 127 128 public long f() { 129 return this.e; 130 } 131 132 public long g() { 133 return this.g; 134 } 135 136 public int h() { 137 return this.i; 138 } 139 140 public void a(long i) { 141 this.e = i; 142 } 143 144 public void b(long i) { 145 this.g = i; 146 } 147 148 public void setSpawn(int i, int j, int k) { 149 this.b = i; 150 this.c = j; 151 this.d = k; 152 } 153 154 public void a(String s) { 155 this.name = s; 156 } 157 158 public int i() { 159 return this.k; 160 } 161 162 public void a(int i) { 163 this.k = i; 164 } 165 166 public boolean isThundering() { 167 // uberbukkit 168 if (Uberbukkit.getTargetPVN() < 11) return false; 169 170 return this.n; 171 } 172 173 public void setThundering(boolean flag) { 174 this.n = flag; 175 } 176 177 public int getThunderDuration() { 178 return this.o; 179 } 180 181 public void setThunderDuration(int i) { 182 this.o = i; 183 } 184 185 public boolean hasStorm() { 186 // uberbukkit 187 if (Uberbukkit.getTargetPVN() < 11) return false; 188 189 return this.l; 190 } 191 192 public void setStorm(boolean flag) { 193 this.l = flag; 194 } 195 196 public int getWeatherDuration() { 197 return this.m; 198 } 199 200 public void setWeatherDuration(int i) { 201 this.m = i; 202 } 203}