3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-07 12:00:07 +01:00

Use BiomeType here

Dieser Commit ist enthalten in:
Jesse Boyd 2019-04-05 03:17:21 +11:00
Ursprung 33f5322fda
Commit 95c819684c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
2 geänderte Dateien mit 9 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -9,6 +9,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import java.util.*;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes;
import org.bukkit.ChunkSnapshot;
import org.bukkit.block.Biome;
@ -55,16 +56,16 @@ public class BukkitChunk_All_ReadonlySnapshot extends FaweChunk {
}
@Override
public byte[] getBiomeArray() {
public BiomeType[] getBiomeArray() {
if (!hasBiomes || next.biomes == null) return null;
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;
for (int z = 0; z < 16; z++) {
for (int x = 0; x < 16; x++, index++) {
if (biomes[index] != 0) {
if (biomes[index] != null) {
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
public void setBiome(int x, int z, byte biome) {
public void setBiome(int x, int z, BiomeType biome) {
throw new UnsupportedOperationException("Read only");
}

Datei anzeigen

@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentMap;
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.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
@ -230,9 +231,9 @@ public class BukkitQueue_All extends BukkitQueue_0<ChunkSnapshot, ChunkSnapshot,
}
@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);
return getAdapter().getBiomeId(biome);
return getAdapter().adapt(biome);
}
@Override