Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-03 01:50:07 +01:00
Add biome storage to BlockArrayClipboard.
Dieser Commit ist enthalten in:
Ursprung
4e66b9a336
Commit
a80420d14b
@ -51,6 +51,7 @@ public class BlockArrayClipboard implements Clipboard {
|
||||
private final Region region;
|
||||
private BlockVector3 origin;
|
||||
private final BaseBlock[][][] blocks;
|
||||
private BiomeType[][] biomes = null;
|
||||
private final List<ClipboardEntity> entities = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@ -162,11 +163,25 @@ public class BlockArrayClipboard implements Clipboard {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(BlockVector2 position) {
|
||||
if (biomes != null
|
||||
&& position.containedWithin(getMinimumPoint().toBlockVector2(), getMaximumPoint().toBlockVector2())) {
|
||||
BlockVector2 v = position.subtract(region.getMinimumPoint().toBlockVector2());
|
||||
return biomes[v.getBlockX()][v.getBlockZ()];
|
||||
}
|
||||
|
||||
return BiomeTypes.OCEAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||
if (position.containedWithin(getMinimumPoint().toBlockVector2(), getMaximumPoint().toBlockVector2())) {
|
||||
BlockVector2 v = position.subtract(region.getMinimumPoint().toBlockVector2());
|
||||
if (biomes == null) {
|
||||
biomes = new BiomeType[region.getWidth()][region.getLength()];
|
||||
}
|
||||
biomes[v.getBlockX()][v.getBlockZ()] = biome;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
throw new IOException("This schematic version is currently not supported");
|
||||
}
|
||||
|
||||
private Clipboard readVersion1(CompoundTag schematicTag) throws IOException {
|
||||
private BlockArrayClipboard readVersion1(CompoundTag schematicTag) throws IOException {
|
||||
BlockVector3 origin;
|
||||
Region region;
|
||||
Map<String, Tag> schematic = schematicTag.getValue();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren