Java Code Examples for codechicken.lib.util.ServerUtils#sendChatToAll()

The following examples show how to use codechicken.lib.util.ServerUtils#sendChatToAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NEIServerUtils.java    From NotEnoughItems with MIT License 5 votes vote down vote up
public static void toggleRaining(World world, boolean notify) {
    boolean raining = !world.isRaining();
    if (!raining)//turn off
    {
        ((WorldServer) world).provider.resetRainAndThunder();
    } else {
        world.getWorldInfo().setRaining(!isRaining(world));
    }

    if (notify) {
        ServerUtils.sendChatToAll(new TextComponentTranslation("nei.chat.rain." + (raining ? "on" : "off")));
    }
}
 
Example 2
Source File: NEIServerUtils.java    From NotEnoughItems with MIT License 5 votes vote down vote up
public static void setHourForward(World world, int hour, boolean notify) {
    long day = (getTime(world) / 24000L) * 24000L;
    long newTime = day + 24000L + hour * 1000;
    setTime(newTime, world);
    if (notify) {
        ServerUtils.sendChatToAll(new TextComponentTranslation("nei.chat.time", getTime(world) / 24000L, hour));
    }
}