mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Improve biome detection imports
This commit is contained in:
1 parent
3e6b37ac05
commit
ce0f5b7a78
2 files changed
+29
No files matched your search
@@ -32,6 +32,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeDictionary.Type;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.api.*;
|
||||
@@ -277,7 +279,15 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
@Override
|
||||
public String[] getAllBiomeNames() {
|
||||
List<String> biomes = new ArrayList<>();
|
||||
Set<BiomeGenBase> allBiomes = new HashSet<BiomeGenBase>();
|
||||
for (Type type : BiomeDictionary.Type.values()) {
|
||||
allBiomes.addAll(BiomeDictionary.getBiomesForType(type));
|
||||
}
|
||||
for (BiomeGenBase base : BiomeGenBase.getBiomeGenArray()) {
|
||||
if (base != null)
|
||||
allBiomes.add(base);
|
||||
}
|
||||
for (BiomeGenBase base : allBiomes) {
|
||||
if (base != null && base.biomeName != null) {
|
||||
biomes.add(base.biomeName);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user