Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
Use BiomeType here
Dieser Commit ist enthalten in:
Ursprung
33f5322fda
Commit
95c819684c
@ -9,6 +9,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import org.bukkit.ChunkSnapshot;
|
import org.bukkit.ChunkSnapshot;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
@ -55,16 +56,16 @@ public class BukkitChunk_All_ReadonlySnapshot extends FaweChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getBiomeArray() {
|
public BiomeType[] getBiomeArray() {
|
||||||
if (!hasBiomes || next.biomes == null) return null;
|
if (!hasBiomes || next.biomes == null) return null;
|
||||||
BukkitImplAdapter adapter = getParent().getAdapter();
|
BukkitImplAdapter adapter = getParent().getAdapter();
|
||||||
byte[] biomes = Arrays.copyOf(next.biomes, next.biomes.length);
|
BiomeType[] biomes = Arrays.copyOf(next.biomes, next.biomes.length);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (int z = 0; z < 16; z++) {
|
for (int z = 0; z < 16; z++) {
|
||||||
for (int x = 0; x < 16; x++, index++) {
|
for (int x = 0; x < 16; x++, index++) {
|
||||||
if (biomes[index] != 0) {
|
if (biomes[index] != null) {
|
||||||
Biome biome = snapshot.getBiome(x, z);
|
Biome biome = snapshot.getBiome(x, z);
|
||||||
biomes[index] = (byte) adapter.getBiomeId(biome);
|
biomes[index] = adapter.adapt(biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,7 +141,7 @@ public class BukkitChunk_All_ReadonlySnapshot extends FaweChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int z, byte biome) {
|
public void setBiome(int x, int z, BiomeType biome) {
|
||||||
throw new UnsupportedOperationException("Read only");
|
throw new UnsupportedOperationException("Read only");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -230,9 +231,9 @@ public class BukkitQueue_All extends BukkitQueue_0<ChunkSnapshot, ChunkSnapshot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBiome(ChunkSnapshot chunkSnapshot, int x, int z) {
|
public BiomeType getBiome(ChunkSnapshot chunkSnapshot, int x, int z) {
|
||||||
Biome biome = chunkSnapshot.getBiome(x & 15, z & 15);
|
Biome biome = chunkSnapshot.getBiome(x & 15, z & 15);
|
||||||
return getAdapter().getBiomeId(biome);
|
return getAdapter().adapt(biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren