Search in sources :

Example 1 with MessagePlayOutSetDifficulty

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetDifficulty in project LanternServer by LanternPowered.

the class LanternWorldProperties method setDifficulty.

@Override
public void setDifficulty(Difficulty difficulty) {
    checkNotNull(difficulty, "difficulty");
    if (this.getDifficulty() != difficulty && this.world != null) {
        this.world.broadcast(() -> new MessagePlayOutSetDifficulty((LanternDifficulty) difficulty));
    }
    this.worldConfig.setDifficulty(difficulty);
}
Also used : LanternDifficulty(org.lanternpowered.server.world.difficulty.LanternDifficulty) MessagePlayOutSetDifficulty(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetDifficulty)

Aggregations

MessagePlayOutSetDifficulty (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSetDifficulty)1 LanternDifficulty (org.lanternpowered.server.world.difficulty.LanternDifficulty)1