Files
MinecraftForge/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java
T

56 lines
1.7 KiB
Java
Raw Normal View History

2017-02-24 10:12:27 +08:00
/*
* Minecraft Forge
* Copyright (c) 2016-2021.
2017-02-24 10:12:27 +08:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.event;
2019-05-23 16:02:15 -07:00
import net.minecraft.world.Difficulty;
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>
* 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
}