2017-02-24 10:12:27 +08:00
|
|
|
/*
|
2022-02-28 13:41:23 -08:00
|
|
|
* Minecraft Forge - Forge Development LLC
|
|
|
|
|
* SPDX-License-Identifier: LGPL-2.1-only
|
2017-02-24 10:12:27 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package net.minecraftforge.event;
|
|
|
|
|
|
2019-05-23 16:02:15 -07:00
|
|
|
import net.minecraft.world.Difficulty;
|
2021-11-26 05:09:56 +08:00
|
|
|
import net.minecraftforge.common.ForgeHooks;
|
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2018-06-10 21:12:46 -04:00
|
|
|
import net.minecraftforge.eventbus.api.Event;
|
2017-02-24 10:12:27 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DifficultyChangeEvent is fired when difficulty is changing. <br>
|
|
|
|
|
* <br>
|
2021-11-26 05:09:56 +08:00
|
|
|
* This event is fired via the {@link ForgeHooks#onDifficultyChange(Difficulty, Difficulty)}.<br>
|
2017-02-24 10:12:27 +08:00
|
|
|
* <br>
|
|
|
|
|
* This event does not have a result. {@link HasResult}<br>
|
|
|
|
|
* <br>
|
|
|
|
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
|
|
|
|
**/
|
2020-09-10 12:01:34 -07:00
|
|
|
public class DifficultyChangeEvent extends Event
|
2017-02-24 10:12:27 +08:00
|
|
|
{
|
2019-05-23 16:02:15 -07:00
|
|
|
private final Difficulty difficulty;
|
|
|
|
|
private final Difficulty oldDifficulty;
|
2017-02-24 10:12:27 +08:00
|
|
|
|
2019-05-23 16:02:15 -07:00
|
|
|
public DifficultyChangeEvent(Difficulty difficulty, Difficulty oldDifficulty)
|
2017-02-24 10:12:27 +08:00
|
|
|
{
|
|
|
|
|
this.difficulty = difficulty;
|
|
|
|
|
this.oldDifficulty = oldDifficulty;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-23 16:02:15 -07:00
|
|
|
public Difficulty getDifficulty()
|
2017-02-24 10:12:27 +08:00
|
|
|
{
|
|
|
|
|
return difficulty;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-23 16:02:15 -07:00
|
|
|
public Difficulty getOldDifficulty()
|
2017-02-24 10:12:27 +08:00
|
|
|
{
|
|
|
|
|
return oldDifficulty;
|
|
|
|
|
}
|
2018-09-22 03:40:22 -07:00
|
|
|
}
|