mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 03:48:01 +01:00
Added support back in for biome temperature and rainfall in snapshots.
This commit is contained in:
parent
5534efd66f
commit
3f4ee9ab56
@ -164,9 +164,12 @@ public class CraftChunk implements Chunk {
|
|||||||
if (includeBiomeTempRain) {
|
if (includeBiomeTempRain) {
|
||||||
biomeTemp = new double[256];
|
biomeTemp = new double[256];
|
||||||
biomeRain = new double[256];
|
biomeRain = new double[256];
|
||||||
//System.arraycopy(wcm.temperature, 0, biomeTemp, 0, biomeTemp.length);
|
float[] dat = wcm.a((float[]) null, getX() << 4, getZ() << 4, 16, 16);
|
||||||
//System.arraycopy(wcm.rain, 0, biomeRain, 0, biomeRain.length);
|
for(int i = 0; i < 256; i++)
|
||||||
// TODO: Figure out new snapshot stuff
|
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();
|
World world = getWorld();
|
||||||
@ -219,9 +222,12 @@ public class CraftChunk implements Chunk {
|
|||||||
if (includeBiomeTempRain) {
|
if (includeBiomeTempRain) {
|
||||||
biomeTemp = new double[256];
|
biomeTemp = new double[256];
|
||||||
biomeRain = new double[256];
|
biomeRain = new double[256];
|
||||||
//System.arraycopy(wcm.temperature, 0, biomeTemp, 0, biomeTemp.length);
|
float[] dat = wcm.a((float[]) null, x << 4, z << 4, 16, 16);
|
||||||
//System.arraycopy(wcm.rain, 0, biomeRain, 0, biomeRain.length);
|
for(int i = 0; i < 256; i++)
|
||||||
// TODO: Figure out new snapshot stuff
|
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);
|
return new EmptyChunkSnapshot(x, z, world.getName(), world.getFullTime(), biome, biomeTemp, biomeRain);
|
||||||
|
@ -138,7 +138,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
* @return Biome at given coordinate
|
* @return Biome at given coordinate
|
||||||
*/
|
*/
|
||||||
public Biome getBiome(int x, int z) {
|
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
|
* @return temperature at given coordinate
|
||||||
*/
|
*/
|
||||||
public double getRawBiomeTemperature(int x, int z) {
|
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
|
* @return rainfall at given coordinate
|
||||||
*/
|
*/
|
||||||
public double getRawBiomeRainfall(int x, int z) {
|
public double getRawBiomeRainfall(int x, int z) {
|
||||||
return biomeRain[x << 4 | z];
|
return biomeRain[z << 4 | x];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user