Search in sources :

Example 1 with LOTRBiome

use of lotr.common.world.biome.LOTRBiome in project pvp-mode by VulcanForge.

the class MiddleEarthBiomeOverrideCondition method isPvPEnabled.

@Override
public Boolean isPvPEnabled(EntityPlayer player) {
    Boolean pvpEnabled = null;
    BiomeGenBase currentBiome = player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ);
    // Check if we are in a relevant LOTR biome
    if (currentBiome instanceof LOTRBiome && configurationData.containsKey(currentBiome.biomeID)) {
        for (BiomeFactionEntry entry : configurationData.get(currentBiome.biomeID)) {
            Boolean enabled = handleCondition(entry, player);
            if (enabled != null) {
                pvpEnabled = enabled;
            }
        }
    }
    return pvpEnabled;
}
Also used : LOTRBiome(lotr.common.world.biome.LOTRBiome) BiomeGenBase(net.minecraft.world.biome.BiomeGenBase)

Aggregations

LOTRBiome (lotr.common.world.biome.LOTRBiome)1 BiomeGenBase (net.minecraft.world.biome.BiomeGenBase)1