mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 02:26:00 +01:00
Add additional chunk-info to /bluemap debug block
This commit is contained in:
parent
3913878e20
commit
a1baff4579
@ -60,10 +60,9 @@
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.map.MapRenderState;
|
||||
import de.bluecolored.bluemap.core.mca.ChunkAnvil112;
|
||||
import de.bluecolored.bluemap.core.mca.MCAChunk;
|
||||
import de.bluecolored.bluemap.core.mca.MCAWorld;
|
||||
import de.bluecolored.bluemap.core.resourcepack.ParseResourceException;
|
||||
import de.bluecolored.bluemap.core.world.Block;
|
||||
import de.bluecolored.bluemap.core.world.Chunk;
|
||||
import de.bluecolored.bluemap.core.world.World;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -531,21 +530,22 @@ public int debugBlockCommand(CommandContext<S> context) {
|
||||
Vector3i blockPos = position.floor().toInt();
|
||||
Block block = world.getBlock(blockPos);
|
||||
Block blockBelow = world.getBlock(blockPos.add(0, -1, 0));
|
||||
|
||||
|
||||
String blockIdMeta = "";
|
||||
String blockBelowIdMeta = "";
|
||||
|
||||
if (world instanceof MCAWorld) {
|
||||
MCAChunk chunk = ((MCAWorld) world).getChunk(MCAWorld.blockToChunk(blockPos));
|
||||
if (chunk instanceof ChunkAnvil112) {
|
||||
blockIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos) + ")";
|
||||
blockBelowIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos.add(0, -1, 0)) + ")";
|
||||
}
|
||||
|
||||
Vector2i chunkPos = world.getChunkGrid().getCell(blockPos.toVector2(true));
|
||||
Chunk chunk = world.getChunk(chunkPos.getX(), chunkPos.getY());
|
||||
|
||||
if (chunk instanceof ChunkAnvil112) {
|
||||
blockIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos) + ")";
|
||||
blockBelowIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos.add(0, -1, 0)) + ")";
|
||||
}
|
||||
|
||||
source.sendMessages(Arrays.asList(
|
||||
Text.of(TextColor.GOLD, "Block at you: ", TextColor.WHITE, block, TextColor.GRAY, blockIdMeta),
|
||||
Text.of(TextColor.GOLD, "Block below you: ", TextColor.WHITE, blockBelow, TextColor.GRAY, blockBelowIdMeta)
|
||||
Text.of(TextColor.GOLD, "Block below you: ", TextColor.WHITE, blockBelow, TextColor.GRAY, blockBelowIdMeta),
|
||||
Text.of(TextColor.GOLD, "Chunk: ", TextColor.WHITE, chunk)
|
||||
));
|
||||
}).start();
|
||||
|
||||
|
@ -79,4 +79,12 @@ public static MCAChunk empty() {
|
||||
return EmptyChunk.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MCAChunk{" +
|
||||
"dataVersion=" + dataVersion +
|
||||
"isGenerated()=" + isGenerated() +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user