Archived
0

правка кода в угоду обновленным интерфейсам

This commit is contained in:
2018-10-28 21:13:58 +03:00
parent d100d5a182
commit 19f9785981
4 changed files with 20 additions and 9 deletions

View File

@@ -54,4 +54,12 @@ public class AnvilBlock implements Block {
public Stream<Tag<?>> tagStream() { public Stream<Tag<?>> tagStream() {
return null; return null;
} }
@Override
public String toString() {
return "AnvilBlock{" +
"location=" + location +
", type=" + getBlockType() +
'}';
}
} }

View File

@@ -60,12 +60,12 @@ public class AnvilChunk implements Chunk {
} }
@Override @Override
public Biome getBiome(int localX, int localZ) { public Biome getBiomeLocal(int x, int z) {
return Biome.getById( biomes.get( localZ << 4 | localX ) & 255 ); return Biome.getById( biomes.get( z << 4 | x) & 255 );
} }
@Override @Override
public void setBiome(int localX, int localZ, Biome biome) { public void setBiomeLocal(int x, int z, Biome biome) {
// nope... // nope...
} }
} }

View File

@@ -7,6 +7,7 @@ import mc.core.world.chunk.Chunk;
import mc.core.world.chunk.ChunkProvider; import mc.core.world.chunk.ChunkProvider;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
@Slf4j @Slf4j
@@ -17,7 +18,9 @@ public class AnvilChunkProvider implements ChunkProvider {
private RegionManager regionManager; private RegionManager regionManager;
public AnvilChunkProvider(String mapPath) { public AnvilChunkProvider(String mapPath) {
this.setRegionManager(new RegionManager(Paths.get(mapPath).resolve("region"))); Path pathMap = Paths.get(mapPath);
log.info("Use Anvil map from \"{}\"", pathMap);
this.setRegionManager(new RegionManager(pathMap.resolve("region")));
} }
@Override @Override

View File

@@ -35,7 +35,7 @@ public class AnvilChunkSection implements ChunkSection {
} }
@Override @Override
public Block getBlock(int x, int y, int z) { public Block getBlockLocal(int x, int y, int z) {
return new AnvilBlock(this, x, y, z); return new AnvilBlock(this, x, y, z);
} }
@@ -45,12 +45,12 @@ public class AnvilChunkSection implements ChunkSection {
} }
@Override @Override
public int getSkyLight(int x, int y, int z) { public int getSkyLightLocal(int x, int y, int z) {
return skyLight.get(x, y, z); return skyLight.get(x, y, z);
} }
@Override @Override
public void setSkyLight(int x, int y, int z, int lightLevel) { public void setSkyLightLocal(int x, int y, int z, int lightLevel) {
} }
@@ -65,7 +65,7 @@ public class AnvilChunkSection implements ChunkSection {
} }
@Override @Override
public Biome getBiome(int localX, int localZ) { public Biome getBiomeLocal(int x, int z) {
return parent.getBiome(localX, localZ); return parent.getBiome(x, z);
} }
} }