mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
[1.13.x] Fire InputEvents (#5533)
This commit is contained in:
1 parent
8515b9dd10
commit
bbc92fa51c
7 files changed
+148
-54
No files matched your search
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* 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.fml.common.gameevent;
|
||||
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
public class InputEvent extends Event {
|
||||
public static class MouseInputEvent extends InputEvent {}
|
||||
public static class KeyInputEvent extends InputEvent {}
|
||||
}
|
||||
@@ -28,22 +28,11 @@ import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class BasicEventHooks
|
||||
{
|
||||
public static void fireMouseInput()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new InputEvent.MouseInputEvent());
|
||||
}
|
||||
|
||||
public static void fireKeyInput()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new InputEvent.KeyInputEvent());
|
||||
}
|
||||
|
||||
public static void firePlayerChangedDimensionEvent(EntityPlayer player, DimensionType fromDim, DimensionType toDim)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim));
|
||||
|
||||
Reference in new issue
Block a user