renamed: Chunk --> ChunkSection
This commit is contained in:
@@ -25,7 +25,7 @@ public class FlatWorld implements World {
|
||||
@Getter
|
||||
@Setter
|
||||
private WarpPosition spawn = new WarpPosition(new Location(0, 6, 0), new Look(0, 0));
|
||||
private Chunk chunk = new SimpleChunk();
|
||||
private ChunkSection chunkSection = new SimpleChunkSection();
|
||||
|
||||
@Override
|
||||
public IWorldType getWorldType() {
|
||||
@@ -33,12 +33,12 @@ public class FlatWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk getChunk(int x, int y, int z) {
|
||||
return chunk;
|
||||
public ChunkSection getChunk(int x, int y, int z) {
|
||||
return chunkSection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChunk(int x, int y, int z, Chunk chunk) {
|
||||
public void setChunk(int x, int y, int z, ChunkSection chunkSection) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* DmitriyMX <dimon550@gmail.com>
|
||||
* 2018-04-28
|
||||
*/
|
||||
package mc.world.flat;
|
||||
|
||||
import mc.core.block.Block;
|
||||
import mc.core.block.BlockFactory;
|
||||
import mc.core.block.BlockType;
|
||||
import mc.core.world.Biome;
|
||||
import mc.core.world.Chunk;
|
||||
import mc.core.world.Region;
|
||||
import mc.core.world.World;
|
||||
|
||||
public class SimpleChunk implements Chunk {
|
||||
@Override
|
||||
public int getBlockType(int x, int y, int z) {
|
||||
if (y == 0) return 7;
|
||||
else if (y >= 1 && y <= 2) return 3;
|
||||
else if (y == 3) return 2;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockType(int x, int y, int z, int type) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockMetadata(int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockMetadata(int x, int y, int z, int metadata) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockLight(int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockLight(int x, int y, int z, int lightLevel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSkyLight(int x, int y, int z) {
|
||||
if (y <= 3) return 0;
|
||||
else return 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSkyLight(int x, int y, int z, int lightLevel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAddition(int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAddition(int x, int y, int z, int value) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome getBiome(int x, int z) {
|
||||
return Biome.PLAINS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int z, Biome biome) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZ() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlock(int x, int y, int z, Block block) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int x, int y, int z) {
|
||||
BlockFactory blockFactory = new BlockFactory();
|
||||
|
||||
if (y == 0) return blockFactory.create(BlockType.BEDROCK, 0);
|
||||
else if (y >= 1 && y <= 2) return blockFactory.create(BlockType.DIRT, 0);
|
||||
else if (y == 3) return blockFactory.create(BlockType.GRASS, 0);
|
||||
else return Block.airBlock(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Region getRegion() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user