public static boolean shouldAddRainParticles(World world, Biome biome) { if (BiomeConfig.usesTropicalSeasons(biome) && BiomeConfig.enablesSeasonalEffects(biome) && SeasonsConfig.isDimensionWhitelisted(world.provider.getDimension())) { Season.TropicalSeason tropicalSeason = SeasonHelper.getSeasonState(world).getTropicalSeason(); switch ((Season.TropicalSeason) tropicalSeason) { case MID_DRY: return false; case MID_WET: return true; default: return biome.canRain(); } } return biome.canRain(); } }
public static boolean shouldRenderRainSnow(World world, Biome biome) { if (BiomeConfig.usesTropicalSeasons(biome) && BiomeConfig.enablesSeasonalEffects(biome) && SeasonsConfig.isDimensionWhitelisted(world.provider.getDimension())) { Season.TropicalSeason tropicalSeason = SeasonHelper.getSeasonState(world).getTropicalSeason(); switch ((Season.TropicalSeason) tropicalSeason) { case MID_DRY: return false; case MID_WET: return true; default: return biome.canRain() || biome.getEnableSnow(); } } return biome.canRain() || biome.getEnableSnow(); }
private boolean canSeeSunClearly(World world, BlockPos blockPos) { if(!world.canSeeSky(blockPos)) { return false; } if(world.isRaining()) { Biome biome = world.getBiome(blockPos); if(biome.canRain() || biome.getEnableSnow()) { return false; } } return world.isDaytime(); } }
public static boolean isRainingAtInSeason(World world, BlockPos pos, ISeasonState seasonState) { Biome biome = world.getBiome(pos); if (BiomeConfig.usesTropicalSeasons(biome) && BiomeConfig.enablesSeasonalEffects(biome) && SeasonsConfig.isDimensionWhitelisted(world.provider.getDimension())) { Season.TropicalSeason tropicalSeason = seasonState.getTropicalSeason(); switch ((Season.TropicalSeason) tropicalSeason) { case MID_DRY: return false; case MID_WET: return true; default: return biome.canRain(); } } if (biome.getEnableSnow() || (world.canSnowAt(pos, false))) { return false; } return biome.canRain(); }
public static boolean isRainingAt(World world, BlockPos pos) { Biome biome = world.getBiome(pos); Weather weather = HFApi.calendar.getWeather(world); return (weather.isRain() || (weather.isSnow() && biome.isHighHumidity())) && world.canBlockSeeSky(pos) && world.getPrecipitationHeight(pos).getY() <= pos.getY() && world.getBiome(pos).canRain(); } }
@SubscribeEvent public void getGrassColor(GetGrassColor event) { if (!event.getBiome().canRain() || event.getBiome().isHighHumidity()) return; int grass = HFTrackers.getCalendar(MCClientHelper.getWorld()).getSeasonData().grassColor; if (grass != 0) { event.setNewColor(CalendarHelper.getBlendedColour(grassToBlend, event.getOriginalColor(), grass)); } } }
IBlockState iblockstate = world.getBlockState(blockpos2); if (blockpos1.getY() <= blockpos.getY() + 10 && blockpos1.getY() >= blockpos.getY() - 10 && biome.canRain()) { double d3 = random.nextDouble(); double d4 = random.nextDouble();
@SubscribeEvent public void getFoliageColor(GetFoliageColor event) { if (!event.getBiome().canRain() || event.getBiome().isHighHumidity()) return; if (HFApi.calendar.getDate(MCClientHelper.getWorld()).getSeason() == Season.AUTUMN) { event.setNewColor(0xFF9900); } else { int leaves = HFTrackers.getCalendar(MCClientHelper.getWorld()).getSeasonData().leavesColor; if (leaves != 0) { event.setNewColor(CalendarHelper.getBlendedColour(leavesToBlend, event.getOriginalColor(), leaves)); } } }
@Override public boolean canSnowAt(@Nonnull BlockPos pos, boolean checkLight) { Biome biome = world.getBiome(pos); if (!biome.canRain() || biome.isHighHumidity()) { return super.canSnowAt(pos, checkLight); } else if (biome.isSnowyBiome()) { Weather weather = HFApi.calendar.getWeather(world); return !weather.isRain() && super.canSnowAt(pos, checkLight); } else { Weather weather = HFApi.calendar.getWeather(world); float f = biome.getFloatTemperature(pos); if (weather.isSnow() && f > 0.15F) { if (!checkLight) { return true; } else { if (pos.getY() >= 0 && pos.getY() < 256 && world.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) { IBlockState iblockstate = world.getBlockState(pos); if (iblockstate.getBlock() != Blocks.SNOW_LAYER && iblockstate.getBlock().isReplaceable(world, pos) && Blocks.SNOW_LAYER.canPlaceBlockAt(world, pos)) { HFApi.tickable.addTickable(world, pos, SnowLoader.INSTANCE); return true; } } return false; } } else return super.canSnowAt(pos, checkLight); } }
if (k2 != l2) { Biome biome = mc.world.getBiome(blockpos$mutableblockpos); if (biome.canRain() && !biome.isHighHumidity()) { if (weather == Weather.BLIZZARD) { fogTarget = -20000;
@Override public void updateServerSide() { if (updateOnInterval(20)) { IErrorLogic errorLogic = getErrorLogic(); BlockPos pos = getPos(); Biome biome = world.getBiome(pos); errorLogic.setCondition(!biome.canRain(), EnumErrorCode.NO_RAIN_BIOME); BlockPos posAbove = pos.up(); boolean hasSky = world.canBlockSeeSky(posAbove); errorLogic.setCondition(!hasSky, EnumErrorCode.NO_SKY_RAIN_TANK); errorLogic.setCondition(!world.isRainingAt(posAbove), EnumErrorCode.NOT_RAINING); if (!errorLogic.hasErrors()) { resourceTank.fillInternal(WATER_PER_UPDATE, true); } containerFiller.updateServerSide(); } if (canDumpBelow == null) { canDumpBelow = FluidHelper.canAcceptFluid(world, getPos().down(), EnumFacing.UP, STACK_WATER); } if (canDumpBelow) { if (dumpingFluid || updateOnInterval(20)) { dumpingFluid = dumpFluidBelow(); } } }
@Override public boolean canBlockFreeze(@Nonnull BlockPos pos, boolean byWater) { Biome biome = world.getBiome(pos); if (!biome.canRain() || biome.isHighHumidity()) { return super.canBlockFreeze(pos, byWater); } else if (biome.isSnowyBiome()) {
Biome biome = world.getBiome(blockpos$mutableblockpos); if (biome.canRain() || biome.getEnableSnow()) { int j2 = world.getPrecipitationHeight(blockpos$mutableblockpos).getY(); int k2 = j - i1;