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

38 lines
1.1 KiB
Java
Raw Normal View History

2017-02-24 10:12:27 +08:00
/*
* Copyright (c) Forge Development LLC and contributors
* 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;
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}.
**/
2025-04-19 13:18:48 +01:00
public final class DifficultyChangeEvent extends Event {
2019-05-23 16:02:15 -07:00
private final Difficulty difficulty;
private final Difficulty oldDifficulty;
2017-02-24 10:12:27 +08:00
2024-04-30 10:56:00 -07:00
public DifficultyChangeEvent(Difficulty difficulty, Difficulty oldDifficulty) {
2017-02-24 10:12:27 +08:00
this.difficulty = difficulty;
this.oldDifficulty = oldDifficulty;
}
2024-04-30 10:56:00 -07:00
public Difficulty getDifficulty() {
2017-02-24 10:12:27 +08:00
return difficulty;
}
2024-04-30 10:56:00 -07:00
public Difficulty getOldDifficulty() {
2017-02-24 10:12:27 +08:00
return oldDifficulty;
}
2018-09-22 03:40:22 -07:00
}