use of net.minecraft.world.biome.BiomeGenBase in project ForestryMC by ForestryMC.
the class GuiHabitatLocator method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
String str = StatCollector.translateToLocal("item.for.habitatLocator.name").toUpperCase();
fontRendererObj.drawString(str, startX + 8 + getCenteredOffset(str, 138), startY + 16, fontColor.get("gui.screen"));
// Set active according to valid biomes.
Set<BiomeDictionary.Type> activeBiomeTypes = new HashSet<BiomeDictionary.Type>();
for (HabitatSlot habitatSlot : habitatSlots) {
habitatSlot.isActive = false;
}
for (BiomeGenBase biome : inventory.biomesToSearch) {
Collections.addAll(activeBiomeTypes, BiomeDictionary.getTypesForBiome(biome));
}
for (BiomeDictionary.Type biomeType : activeBiomeTypes) {
HabitatSlot habitatSlot = biomeToHabitat.get(biomeType);
if (habitatSlot != null) {
habitatSlot.isActive = true;
}
}
for (HabitatSlot slot : habitatSlots) {
slot.draw(startX, startY);
}
// Reset afterwards.
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
use of net.minecraft.world.biome.BiomeGenBase in project ForestryMC by ForestryMC.
the class MachineRaintank method validate.
@Override
public void validate() {
// Raintanks in desert and snow biomes are useless
if (worldObj != null) {
BiomeGenBase biome = Utils.getBiomeAt(worldObj, xCoord, zCoord);
if (!BiomeHelper.canRainOrSnow(biome)) {
setErrorState(EnumErrorCode.INVALIDBIOME);
isValidBiome = false;
}
}
super.validate();
}
use of net.minecraft.world.biome.BiomeGenBase in project ForestryMC by ForestryMC.
the class HiveDecorator method decorateHivesDebug.
private void decorateHivesDebug(World world, int chunkX, int chunkZ, List<Hive> hives) {
int worldX = chunkX * 16;
int worldZ = chunkZ * 16;
BiomeGenBase biome = world.getBiomeGenForCoords(worldX, worldZ);
EnumHumidity humidity = EnumHumidity.getFromValue(biome.rainfall);
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
Collections.shuffle(hives, world.rand);
for (Hive hive : hives) {
if (!hive.isGoodBiome(biome) || !hive.isGoodHumidity(humidity)) {
continue;
}
tryGenHive(world, worldX + x, worldZ + z, hive);
}
}
}
}
Aggregations