/
NetheriteChunk.java
64 lines (52 loc) · 1.83 KB
/
NetheriteChunk.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
package mods.natura.dimension;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
public class NetheriteChunk extends Chunk
{
public NetheriteChunk(World world, byte[] lowerIDs, int chunkX, int chunkZ)
{
super(world, chunkX, chunkZ);
ExtendedBlockStorage[] storage = getBlockStorageArray();
int height = lowerIDs.length / 256;
for (int x = 0; x < 16; ++x)
{
for (int z = 0; z < 16; ++z)
{
for (int y = 0; y < height; ++y)
{
int id = lowerIDs[x << 11 | z << 7 | y] & 0xFF;
if (id != 0)
{
int k1 = y >> 4;
if (storage[k1] == null)
{
storage[k1] = new ExtendedBlockStorage(k1 << 4, !world.provider.hasNoSky);
}
storage[k1].func_150818_a(x, y & 15, z, Block.getBlockById(id));
}
}
}
}
/*for (int x = 0; x < 16; ++x)
{
for (int z = 0; z < 16; ++z)
{
for (int y = 0; y < height; ++y)
{
int id = upperIDs[x << 11 | z << 7 | y] & 0xFF;
if (id != 0)
{
int k1 = (y >> 4) + 8;
if (storage[k1] == null)
{
storage[k1] = new ExtendedBlockStorage(k1 << 4, !world.provider.hasNoSky);
}
storage[k1].setExtBlockID(x, y & 15, z, id);
}
}
}
}*/
}
}