|
| 1 | +/* |
| 2 | + * Minecraft Forge, Patchwork Project |
| 3 | + * Copyright (c) 2016-2020, 2019-2020 |
| 4 | + * |
| 5 | + * This library is free software; you can redistribute it and/or |
| 6 | + * modify it under the terms of the GNU Lesser General Public |
| 7 | + * License as published by the Free Software Foundation version 2.1 |
| 8 | + * of the License. |
| 9 | + * |
| 10 | + * This library is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | + * Lesser General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU Lesser General Public |
| 16 | + * License along with this library; if not, write to the Free Software |
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | + */ |
| 19 | + |
| 20 | +package net.minecraftforge.event; |
| 21 | + |
| 22 | +import net.minecraftforge.common.MinecraftForge; |
| 23 | +import net.minecraftforge.eventbus.api.Event; |
| 24 | + |
| 25 | +import net.minecraft.world.Difficulty; |
| 26 | + |
| 27 | +/** |
| 28 | + * DifficultyChangeEvent is fired when difficulty is changing. |
| 29 | + * |
| 30 | + * <p>TODO: Forge bug: This event is not currently fired. See https://github.com/MinecraftForge/MinecraftForge/issues/6227</p> |
| 31 | + * |
| 32 | + * <p>This event is not cancellable.</p> |
| 33 | + * |
| 34 | + * <p>This event does not have a result.</p> |
| 35 | + * |
| 36 | + * <p>This event is fired on the {@link MinecraftForge#EVENT_BUS}.</p> |
| 37 | + */ |
| 38 | +public class DifficultyChangeEvent extends Event { |
| 39 | + private final Difficulty difficulty; |
| 40 | + private final Difficulty oldDifficulty; |
| 41 | + |
| 42 | + public DifficultyChangeEvent(Difficulty difficulty, Difficulty oldDifficulty) { |
| 43 | + this.difficulty = difficulty; |
| 44 | + this.oldDifficulty = oldDifficulty; |
| 45 | + } |
| 46 | + |
| 47 | + public Difficulty getDifficulty() { |
| 48 | + return difficulty; |
| 49 | + } |
| 50 | + |
| 51 | + public Difficulty getOldDifficulty() { |
| 52 | + return oldDifficulty; |
| 53 | + } |
| 54 | +} |
0 commit comments