@Override public void setWeather(WeatherType weatherType, long duration) { WorldInfo info = getWorld().getWorldInfo(); if (WeatherTypes.THUNDER_STORM.equals(weatherType)) { info.setCleanWeatherTime(0); info.setThundering(true); info.setThunderTime((int) duration); } else if (WeatherTypes.RAIN.equals(weatherType)) { info.setCleanWeatherTime(0); info.setRaining(true); info.setRainTime((int) duration); } else if (WeatherTypes.CLEAR.equals(weatherType)) { info.setRaining(false); info.setThundering(false); info.setCleanWeatherTime((int) duration); } }
protected void thunder(World world, boolean state) { world.getWorldInfo().setThundering(state); }
@Override public void deactivate(World world) { world.getWorldInfo().setThundering(false); }
public static void activateThunder(World world) { WorldInfo worldInfo = world.getWorldInfo(); int i = (300 + world.rand.nextInt(600)) * 20; worldInfo.setRainTime(i); worldInfo.setThunderTime(i); worldInfo.setRaining(true); worldInfo.setThundering(true); }
@Override public void updateInPedestal(@Nonnull World world, @Nonnull BlockPos pos) { if (!world.isRemote && ProjectEConfig.pedestalCooldown.volcanitePedCooldown != -1) { TileEntity te = world.getTileEntity(pos); if(!(te instanceof DMPedestalTile)) { return; } DMPedestalTile tile = (DMPedestalTile) te; if (tile.getActivityCooldown() == 0) { world.getWorldInfo().setRainTime(0); world.getWorldInfo().setThunderTime(0); world.getWorldInfo().setRaining(false); world.getWorldInfo().setThundering(false); tile.setActivityCooldown(ProjectEConfig.pedestalCooldown.volcanitePedCooldown); } else { tile.decrementActivityCooldown(); } } }
@Override public void onUpdate() { super.onUpdate(); if (!world.isRemote && ticksExisted > 400) { setDead(); return; } // Undo the 0.99 (0.8 in water) drag applied in superclass double inverse = 1D / (isInWater() ? 0.8D : 0.99D); motionX *= inverse; motionY *= inverse; motionZ *= inverse; if (!world.isRemote && !isDead && posY > world.getHeight() && world.isRaining()) { world.getWorldInfo().setThundering(true); setDead(); } }
this.world.getWorldInfo().setThundering(data != 0);
event.world.getWorldInfo().setThundering(false);;