diff options
author | Mike Primm <mike@primmhome.com> | 2011-09-15 15:57:37 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2011-09-17 17:12:44 -0400 |
commit | 3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2 (patch) | |
tree | 4d7720d45c7b015caf579850c7f72787da948a8d /src | |
parent | 5534efd66f1a0ffb4344bf3681d1922930e43d23 (diff) | |
download | craftbukkit-3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2.tar craftbukkit-3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2.tar.gz craftbukkit-3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2.tar.lz craftbukkit-3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2.tar.xz craftbukkit-3f4ee9ab563b38d69a596b556bfd1989f8c7b7b2.zip |
Added support back in for biome temperature and rainfall in snapshots.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 18 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java | 6 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index b02b3d37..c03f1c7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -164,9 +164,12 @@ public class CraftChunk implements Chunk { if (includeBiomeTempRain) { biomeTemp = new double[256]; biomeRain = new double[256]; - //System.arraycopy(wcm.temperature, 0, biomeTemp, 0, biomeTemp.length); - //System.arraycopy(wcm.rain, 0, biomeRain, 0, biomeRain.length); - // TODO: Figure out new snapshot stuff + float[] dat = wcm.a((float[]) null, getX() << 4, getZ() << 4, 16, 16); + for(int i = 0; i < 256; i++) + biomeTemp[i] = dat[i]; + dat = wcm.b((float[]) null, getX() << 4, getZ() << 4, 16, 16); + for(int i = 0; i < 256; i++) + biomeRain[i] = dat[i]; } } World world = getWorld(); @@ -219,9 +222,12 @@ public class CraftChunk implements Chunk { if (includeBiomeTempRain) { biomeTemp = new double[256]; biomeRain = new double[256]; - //System.arraycopy(wcm.temperature, 0, biomeTemp, 0, biomeTemp.length); - //System.arraycopy(wcm.rain, 0, biomeRain, 0, biomeRain.length); - // TODO: Figure out new snapshot stuff + float[] dat = wcm.a((float[]) null, x << 4, z << 4, 16, 16); + for(int i = 0; i < 256; i++) + biomeTemp[i] = dat[i]; + dat = wcm.b((float[]) null, x << 4, z << 4, 16, 16); + for(int i = 0; i < 256; i++) + biomeRain[i] = dat[i]; } } return new EmptyChunkSnapshot(x, z, world.getName(), world.getFullTime(), biome, biomeTemp, biomeRain); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java index d53a74c1..2b14f37e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -138,7 +138,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { * @return Biome at given coordinate */ public Biome getBiome(int x, int z) { - return CraftBlock.biomeBaseToBiome(biome[x << 4 | z]); + return CraftBlock.biomeBaseToBiome(biome[z << 4 | x]); } /** @@ -149,7 +149,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { * @return temperature at given coordinate */ public double getRawBiomeTemperature(int x, int z) { - return biomeTemp[x << 4 | z]; + return biomeTemp[z << 4 | x]; } /** @@ -160,7 +160,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { * @return rainfall at given coordinate */ public double getRawBiomeRainfall(int x, int z) { - return biomeRain[x << 4 | z]; + return biomeRain[z << 4 | x]; } /** |