mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
dont set unneeded blocks
This commit is contained in:
parent
51c8da51d3
commit
737f95e458
@ -1,5 +1,6 @@
|
|||||||
package com.dfsek.terra.cli.world.chunk;
|
package com.dfsek.terra.cli.world.chunk;
|
||||||
|
|
||||||
|
import net.querz.mca.Section;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
@ -11,6 +12,8 @@ import com.dfsek.terra.cli.block.CLIBlockState;
|
|||||||
import com.dfsek.terra.cli.handle.CLIWorldHandle;
|
import com.dfsek.terra.cli.handle.CLIWorldHandle;
|
||||||
import com.dfsek.terra.cli.world.CLIWorld;
|
import com.dfsek.terra.cli.world.CLIWorld;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import static com.dfsek.terra.cli.handle.CLIWorldHandle.getAIR;
|
import static com.dfsek.terra.cli.handle.CLIWorldHandle.getAIR;
|
||||||
|
|
||||||
|
|
||||||
@ -69,16 +72,15 @@ public class CLIChunk implements Chunk, ProtoChunk, NBTSerializable<net.querz.mc
|
|||||||
for(int x = 0; x < blocks.length; x++) {
|
for(int x = 0; x < blocks.length; x++) {
|
||||||
for(int z = 0; z < blocks[x].length; z++) {
|
for(int z = 0; z < blocks[x].length; z++) {
|
||||||
for(int y = 0; y < blocks[z][z].length; y++) {
|
for(int y = 0; y < blocks[z][z].length; y++) {
|
||||||
CLIBlockState blockState = blocks[x][z][y];
|
|
||||||
if(blockState == null) {
|
|
||||||
blockState = CLIWorldHandle.getAIR();
|
|
||||||
}
|
|
||||||
int yi = y + minHeight;
|
int yi = y + minHeight;
|
||||||
if(yi < 0 || yi >= 256) continue;
|
if(yi < 0 || yi >= 256) continue;
|
||||||
|
CLIBlockState blockState = blocks[x][z][y];
|
||||||
|
if(blockState != null) {
|
||||||
chunk.setBlockStateAt(x, yi, z, blockState.getNbt(), false);
|
chunk.setBlockStateAt(x, yi, z, blockState.getNbt(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
chunk.setStatus("features");
|
chunk.setStatus("features");
|
||||||
return chunk;
|
return chunk;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user