3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Fixed missing BiomeBase.SKY to Biome.SKY mapping. Thanks mikeprimm!

Dieser Commit ist enthalten in:
EvilSeph 2011-07-14 15:05:43 -04:00
Ursprung cc94325b28
Commit 3c5ecd0854
2 geänderte Dateien mit 35 neuen und 29 gelöschten Zeilen

Datei anzeigen

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit;
import org.bukkit.ChunkSnapshot; import org.bukkit.ChunkSnapshot;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.craftbukkit.block.CraftBlock;
import net.minecraft.server.BiomeBase; import net.minecraft.server.BiomeBase;
/** /**
@ -137,34 +138,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
* @return Biome at given coordinate * @return Biome at given coordinate
*/ */
public Biome getBiome(int x, int z) { public Biome getBiome(int x, int z) {
BiomeBase base = biome[x << 4 | z]; return CraftBlock.biomeBaseToBiome(biome[x << 4 | z]);
if (base == BiomeBase.RAINFOREST) {
return Biome.RAINFOREST;
} else if (base == BiomeBase.SWAMPLAND) {
return Biome.SWAMPLAND;
} else if (base == BiomeBase.SEASONAL_FOREST) {
return Biome.SEASONAL_FOREST;
} else if (base == BiomeBase.FOREST) {
return Biome.FOREST;
} else if (base == BiomeBase.SAVANNA) {
return Biome.SAVANNA;
} else if (base == BiomeBase.SHRUBLAND) {
return Biome.SHRUBLAND;
} else if (base == BiomeBase.TAIGA) {
return Biome.TAIGA;
} else if (base == BiomeBase.DESERT) {
return Biome.DESERT;
} else if (base == BiomeBase.PLAINS) {
return Biome.PLAINS;
} else if (base == BiomeBase.ICE_DESERT) {
return Biome.ICE_DESERT;
} else if (base == BiomeBase.TUNDRA) {
return Biome.TUNDRA;
} else if (base == BiomeBase.HELL) {
return Biome.HELL;
}
return null;
} }
/** /**

Datei anzeigen

@ -330,7 +330,39 @@ public class CraftBlock implements Block {
} }
public Biome getBiome() { public Biome getBiome() {
return getWorld().getBiome(x, z); return biomeBaseToBiome(chunk.getHandle().world.getWorldChunkManager().getBiome(x, z));
}
public static final Biome biomeBaseToBiome(BiomeBase base) {
if (base == BiomeBase.RAINFOREST) {
return Biome.RAINFOREST;
} else if (base == BiomeBase.SWAMPLAND) {
return Biome.SWAMPLAND;
} else if (base == BiomeBase.SEASONAL_FOREST) {
return Biome.SEASONAL_FOREST;
} else if (base == BiomeBase.FOREST) {
return Biome.FOREST;
} else if (base == BiomeBase.SAVANNA) {
return Biome.SAVANNA;
} else if (base == BiomeBase.SHRUBLAND) {
return Biome.SHRUBLAND;
} else if (base == BiomeBase.TAIGA) {
return Biome.TAIGA;
} else if (base == BiomeBase.DESERT) {
return Biome.DESERT;
} else if (base == BiomeBase.PLAINS) {
return Biome.PLAINS;
} else if (base == BiomeBase.ICE_DESERT) {
return Biome.ICE_DESERT;
} else if (base == BiomeBase.TUNDRA) {
return Biome.TUNDRA;
} else if (base == BiomeBase.HELL) {
return Biome.HELL;
} else if (base == BiomeBase.SKY) {
return Biome.SKY;
}
return null;
} }
public double getTemperature() { public double getTemperature() {