extend biome ids, remove biome id saving
This commit is contained in:
parent
f613bd2122
commit
15459fc627
7 changed files with 119 additions and 37 deletions
|
@ -73,7 +73,7 @@ public class SPacketChunkData implements Packet<IClientPlayer>
|
|||
int i = segments * 2 * 16 * 16 * 16;
|
||||
int j = segments * 16 * 16 * 16 / 2;
|
||||
int k = overworld ? segments * 16 * 16 * 16 / 2 : 0;
|
||||
int l = biomes ? 256 : 0;
|
||||
int l = biomes ? 256 * 2 : 0;
|
||||
return i + j + k + l;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.ITileEntityProvider;
|
||||
import common.block.Material;
|
||||
|
@ -31,7 +32,7 @@ public abstract class Chunk {
|
|||
protected final Block fillerBlock;
|
||||
protected final IntHashMap<BlockArray> blocks = new IntHashMap();
|
||||
protected final Set<BlockArray> blockList = Sets.newHashSet();
|
||||
protected final byte[] biomes = new byte[256];
|
||||
protected final char[] biomes = new char[256];
|
||||
protected final int[] precHeight = new int[256];
|
||||
protected final boolean[] updateSky = new boolean[256];
|
||||
protected final int[] height = new int[256];
|
||||
|
@ -61,7 +62,6 @@ public abstract class Chunk {
|
|||
this.entities[y] = new InheritanceMultiMap(Entity.class);
|
||||
}
|
||||
Arrays.fill(this.precHeight, -99999999);
|
||||
Arrays.fill(this.biomes, (byte)-1);
|
||||
}
|
||||
|
||||
public int getHeight(int x, int z) {
|
||||
|
@ -839,4 +839,10 @@ public abstract class Chunk {
|
|||
public int getLowest() {
|
||||
return this.minHeight;
|
||||
}
|
||||
|
||||
public Biome getBiome(BlockPos pos) {
|
||||
int x = pos.getX() & 15;
|
||||
int z = pos.getZ() & 15;
|
||||
return Biome.getBiomeDef(this.biomes[z << 4 | x]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue