use of stevekung.mods.moreplanets.planets.nibiru.world.gen.biome.BiomeInfectedBadlands in project MorePlanets by SteveKunG.
the class WorldTickEventHandler method onWeatherTick.
@SubscribeEvent
public void onWeatherTick(WeatherTickEvent event) {
World world = event.getWorld();
BlockPos pos = event.getStrikePos();
if (DimensionManager.getWorld(ConfigManagerMP.moreplanets_dimension.idDimensionDiona) != null) {
if (world.provider instanceof WorldProviderDiona) {
if (this.canBeamStrike(world, pos) && world.rand.nextInt(75000) == 0) {
if (world.isBlockLoaded(pos)) {
EntityAlienBeam beam = new EntityAlienBeam(world, pos.getX(), pos.getY(), pos.getZ());
beam.spawnWeather();
}
}
}
}
if (DimensionManager.getWorld(ConfigManagerMP.moreplanets_dimension.idDimensionNibiru) != null) {
if (world.provider instanceof WorldProviderNibiru) {
boolean raining = world.isRaining();
boolean thunder = world.isThundering();
Biome biome = world.getBiome(pos);
if (world.provider.canDoLightning(event.getChunk()) && raining && thunder && world.rand.nextInt(1000) == 0) {
if (world.isRainingAt(pos)) {
EntityNibiruLightningBolt boltFire = new EntityNibiruLightningBolt(world, pos.getX(), pos.getY(), pos.getZ(), true);
boltFire.spawnWeather();
}
}
if (world.rand.nextInt(16) == 0) {
BlockPos pos1 = pos.down();
if (world.isAreaLoaded(pos1, 1)) {
if (world.canBlockFreezeNoWater(pos1)) {
world.setBlockState(pos1, MPBlocks.INFECTED_ICE.getDefaultState());
}
}
if (raining) {
if (world.canSnowAt(pos, true)) {
world.setBlockState(pos, biome == MPBiomes.COLD_GREEN_VEIN_MOUTAINS ? MPBlocks.PURIFIED_SNOW_LAYER.getDefaultState() : MPBlocks.INFECTED_SNOW_LAYER.getDefaultState());
}
if (world.getBiome(pos1).canRain()) {
world.getBlockState(pos1).getBlock().fillWithRain(world, pos1);
}
}
}
if (biome instanceof BiomeInfectedDesert || biome instanceof BiomeInfectedMountains || biome instanceof BiomeInfectedBadlands) {
if (world.rand.nextInt(250000) == 0) {
EntityNibiruLightningBolt bolt = new EntityNibiruLightningBolt(world, pos.getX(), pos.getY(), pos.getZ(), false);
bolt.spawnWeather();
}
}
}
}
}
Aggregations