This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
The question is fairly simple, how would I set the weather to rain, for example?
Look at what CommandWeather does.
Here are the important lines:
if ("clear".equalsIgnoreCase(args[0])) { worldinfo.setCleanWeatherTime(i); worldinfo.setRainTime(0); worldinfo.setThunderTime(0); worldinfo.setRaining(false); worldinfo.setThundering(false); notifyOperators(sender, this, "commands.weather.clear", new Object[0]); } else if ("rain".equalsIgnoreCase(args[0])) { worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(i); worldinfo.setThunderTime(i); worldinfo.setRaining(true); worldinfo.setThundering(false); notifyOperators(sender, this, "commands.weather.rain", new Object[0]); } else { if (!"thunder".equalsIgnoreCase(args[0])) { throw new WrongUsageException("commands.weather.usage", new Object[0]); } worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(i); worldinfo.setThunderTime(i); worldinfo.setRaining(true); worldinfo.setThundering(true); notifyOperators(sender, this, "commands.weather.thunder", new Object[0]);[/p] }
Quote from My mindNothing that humanity has done has been impossible. I'm really disappointed in you humanity.
Quote from PisuCat» Look at what CommandWeather does. Here are the important lines: if ("clear".equalsIgnoreCase(args[0])) { worldinfo.setCleanWeatherTime(i); worldinfo.setRainTime(0); worldinfo.setThunderTime(0); worldinfo.setRaining(false); worldinfo.setThundering(false); notifyOperators(sender, this, "commands.weather.clear", new Object[0]); } else if ("rain".equalsIgnoreCase(args[0])) { worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(i); worldinfo.setThunderTime(i); worldinfo.setRaining(true); worldinfo.setThundering(false); notifyOperators(sender, this, "commands.weather.rain", new Object[0]); } else { if (!"thunder".equalsIgnoreCase(args[0])) { throw new WrongUsageException("commands.weather.usage", new Object[0]); } worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(i); worldinfo.setThunderTime(i); worldinfo.setRaining(true); worldinfo.setThundering(true); notifyOperators(sender, this, "commands.weather.thunder", new Object[0]);[/p] }
I've tried this, but it doesn't seem to work.
Here is the code I have:
System.out.println("Raining..."); worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(6500); worldinfo.setThunderTime(6500); worldinfo.setRaining(true); worldinfo.setThundering(false);
Quote from BlisterFingers» I dunno if it makes a difference but you appear to have missed out the notifyOperators line.
I dunno if it makes a difference but you appear to have missed out the notifyOperators line.
Ah, It's in a world event, Here's the full thing:
http://pastebin.com/vMzRnUVG
So it is server side.
WorldTickEvent handlers need to be registered on the FML bus, i.e.
FMLCommonHandler.instance().bus()
rather than:
MinecraftForge.EVENT_BUS
That is all I can think of with the information provided.
That's what I have.
The question is fairly simple, how would I set the weather to rain, for example?
Look at what CommandWeather does.
Here are the important lines:
Thank you
I've tried this, but it doesn't seem to work.
Here is the code I have:
It doesn't make a difference. I just forgot to remove it when putting that up.
Where did you put that code to be specific? I believe it has to be on the server to work.
Ah, It's in a world event, Here's the full thing:
http://pastebin.com/vMzRnUVG
So it is server side.
WorldTickEvent handlers need to be registered on the FML bus, i.e.
FMLCommonHandler.instance().bus()
rather than:
MinecraftForge.EVENT_BUS
That is all I can think of with the information provided.
That's what I have.