Files
MinecraftForge/src/main/java/net/minecraftforge/event/DifficultyChangeEvent.java
T
sciwhiz12 c1874bb5ab Amend license header to include contributors and apply to FML subprojects (#8525)
After internal discussion, it was decided that we need to include
"contributors" to the license header. This avoids claiming that the
Java source files are under the exclusive copyright ownership of Forge
LLC, which excludes contributors that still hold copyright ownership
over their contributions (but is licensed under the LGPLv2.1 as stated
in the Forge CLA).
2022-04-13 20:42:00 -07:00

43 lines
1.1 KiB
Java

/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.event;
import net.minecraft.world.Difficulty;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Event;
/**
* DifficultyChangeEvent is fired when difficulty is changing. <br>
* <br>
* This event is fired via the {@link ForgeHooks#onDifficultyChange(Difficulty, Difficulty)}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public class DifficultyChangeEvent extends Event
{
private final Difficulty difficulty;
private final Difficulty oldDifficulty;
public DifficultyChangeEvent(Difficulty difficulty, Difficulty oldDifficulty)
{
this.difficulty = difficulty;
this.oldDifficulty = oldDifficulty;
}
public Difficulty getDifficulty()
{
return difficulty;
}
public Difficulty getOldDifficulty()
{
return oldDifficulty;
}
}