Archived
0

renamed: Chunk --> ChunkSection

This commit is contained in:
Forwolk
2018-08-04 20:43:07 +03:00
parent aa001b5fe2
commit be98784668
17 changed files with 75 additions and 468 deletions

View File

@@ -110,4 +110,5 @@ public class Location implements Serializable{
public void setWorld (World world) {
this.world = new WeakReference<>(world);
}
}

View File

@@ -1,10 +1,10 @@
package mc.core.serialization;
import mc.core.world.Chunk;
import mc.core.world.ChunkSection;
import mc.core.world.Region;
import java.io.IOException;
public interface IChunkReader {
Chunk read (Region region, int x, int y, int z) throws IOException;
ChunkSection read (Region region, int x, int y, int z) throws IOException;
}

View File

@@ -12,7 +12,7 @@ public interface ChunkLoader {
* @param z chunk position
* @return optional of chunk (nullable)
*/
Optional<Chunk> loadChunk (int x, int y, int z);
Optional<ChunkSection> loadChunk (int x, int y, int z);
/**
* Tries to load chunk like {@link #loadChunk(int, int, int)}
@@ -23,5 +23,5 @@ public interface ChunkLoader {
* @param z chunk position
* @return chunk
*/
Chunk loadOrGenerateChunk (int x, int y, int z);
ChunkSection loadOrGenerateChunk (int x, int y, int z);
}

View File

@@ -22,7 +22,7 @@ import java.io.Serializable;
*
*/
/* 16x16x16 */
public interface Chunk extends Serializable{
public interface ChunkSection extends Serializable{
int getBlockType(int x, int y, int z);
void setBlockType(int x, int y, int z, int type);

View File

@@ -21,8 +21,8 @@ import java.io.Serializable;
*
*/
public interface Region extends Serializable{
Chunk getChunkAt(int x, int y, int z);
void setChunk(int x, int y, int z, Chunk chunk);
ChunkSection getChunkAt(int x, int y, int z);
void setChunk(int x, int y, int z, ChunkSection chunkSection);
int getX();
int getZ();
@@ -32,5 +32,5 @@ public interface Region extends Serializable{
World getWorld();
void save(Serializer<Chunk> chunkSerializer, IRegionReaderWriter regionReaderWritter) throws IOException;
void save(Serializer<ChunkSection> chunkSerializer, IRegionReaderWriter regionReaderWritter) throws IOException;
}

View File

@@ -4,7 +4,6 @@
*/
package mc.core.world;
import mc.core.Location;
import mc.core.WarpPosition;
import mc.core.nbt.Taggable;
@@ -49,8 +48,8 @@ public interface World extends Taggable, Serializable{
WarpPosition getSpawn();
void setSpawn(WarpPosition location);
Chunk getChunk(int x, int y, int z);
void setChunk(int x, int y, int z, Chunk chunk);
ChunkSection getChunk(int x, int y, int z);
void setChunk(int x, int y, int z, ChunkSection chunkSection);
Region getRegion(int x, int z);
void setRegion(int x, int z, Region region);