Registry fixes and debug
This commit is contained in:
parent
b7afcf1ca5
commit
8bdfbb65fa
3 changed files with 24 additions and 2 deletions
|
@ -111,6 +111,10 @@ public class EndBiome {
|
|||
genChance += chance;
|
||||
return genChance;
|
||||
}
|
||||
|
||||
public String debug() {
|
||||
return this.mcID + " " + this.genChanceUnmutable + " " + this.genChance;
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
return biome;
|
||||
|
|
|
@ -2,22 +2,27 @@ package ru.betterend.world.generator;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class BiomePicker {
|
||||
private final Set<Identifier> immutableIDs = Sets.newHashSet();
|
||||
private final List<EndBiome> biomes = Lists.newArrayList();
|
||||
private float maxChanceUnmutable = 0;
|
||||
private float maxChance = 0;
|
||||
private int biomeCount = 0;
|
||||
|
||||
public void addBiome(EndBiome biome) {
|
||||
biomes.add(biome);
|
||||
maxChance = biome.mutateGenChance(maxChance);
|
||||
immutableIDs.add(biome.getID());
|
||||
maxChanceUnmutable = maxChance;
|
||||
biomes.add(biome);
|
||||
biomeCount ++;
|
||||
}
|
||||
|
||||
|
@ -43,4 +48,14 @@ public class BiomePicker {
|
|||
public List<EndBiome> getBiomes() {
|
||||
return biomes;
|
||||
}
|
||||
|
||||
public void debug() {
|
||||
for (EndBiome b: biomes) {
|
||||
System.out.println(b.debug());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsImmutable(Identifier id) {
|
||||
return immutableIDs.contains(id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue