Update preprocessor and replace 1.13.2 subproject with 1.14.4-forge
The new preprocessor version brings first-party support for fabric, in particular for automatically fetching mappings loom and for automatically remapping between MC versions via intermediary mappings. This will come in handy when updating to 1.15. It also supports automatic remapping between fabric and forge on the same MC version (by going mcp<->srg<->mojang<->intermediary<->yarn). Therefore this commit replaces the previous 1.13.2 (forge) subproject with a 1.14.4-forge one. Instead of manually providing full mappings for 1.14.4-fabric to 1.13.2-forge and partial (classes) for 1.13.2-forge to 1.12.2-forge, we now only need partial (classes) for 1.12.2-forge to 1.14.4-forge and preprocessor will take care of the forge to fabric step (in fact, our mapping file for that is currently completely empty). In an attempt to write an IDE (IntelliJ) plugin for quicker and easier working with the preprocessor (e.g. immediately mapping single files from within the IDE, jumping between different versions for the same file), the preprocessor gradle plugin declaration now requires you to explicitly specify variables in the common.gradle and the overall relationship between projects in the build.gradle (latter is required anyway, so the plugin can know where it should map between forge and fabric and which subprojects are which versions). Since that necessitated some changes to the build.gradle file, I took the opportunity to convert it to Kotlin. As such we now also use Gradle's newer plugin-block with the pluginManagement-block instead of manually declaring buildScript (not for the common.gradle though), which imo is nicer anyway and comes with various advantages (see gradle docs). There were also some remapping bugs fixed and some new ones introduced (e.g. manually declared inner class mappings seem to no longer function properly under certain conditions). There's also support for remapping Kotlin now. Just saying.
This commit is contained in:
@@ -9,7 +9,7 @@ import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import com.replaymod.core.versions.LangResourcePack;
|
||||
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
@@ -38,7 +38,7 @@ import java.util.Map;
|
||||
|
||||
public class KeyBindingRegistry extends EventRegistrations {
|
||||
private static final String CATEGORY = "replaymod.title";
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
static { net.fabricmc.fabric.api.client.keybinding.KeyBindingRegistry.INSTANCE.addCategory(CATEGORY); }
|
||||
//#endif
|
||||
|
||||
@@ -58,7 +58,7 @@ public class KeyBindingRegistry extends EventRegistrations {
|
||||
private KeyBinding registerKeyBinding(String name, int keyCode) {
|
||||
KeyBinding keyBinding = keyBindings.get(name);
|
||||
if (keyBinding == null) {
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
if (keyCode == 0) {
|
||||
keyCode = -1;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.resource.DirectoryResourcePack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.text.LiteralText;
|
||||
@@ -30,17 +31,18 @@ import org.apache.commons.io.FileUtils;
|
||||
|
||||
//#if MC>=11400
|
||||
import com.github.steveice10.mc.protocol.MinecraftConstants;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.options.Option;
|
||||
import net.minecraft.resource.DirectoryResourcePack;
|
||||
import net.minecraft.resource.ResourcePackCreator;
|
||||
import net.minecraft.resource.ResourcePackContainer;
|
||||
import net.minecraft.util.NonBlockingThreadExecutor;
|
||||
//#endif
|
||||
|
||||
//#if FABRIC>=1
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
//#else
|
||||
//$$ import com.google.common.util.concurrent.ListenableFutureTask;
|
||||
//$$ import net.minecraft.resources.FolderPack;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//$$ import java.util.Queue;
|
||||
//$$ import java.util.concurrent.FutureTask;
|
||||
@@ -80,8 +82,10 @@ import net.minecraft.util.NonBlockingThreadExecutor;
|
||||
//#endif
|
||||
//#endif
|
||||
//$$ import net.minecraftforge.fml.common.Mod;
|
||||
//#if MC<11400
|
||||
//$$ import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
@@ -97,7 +101,7 @@ import java.util.concurrent.TimeoutException;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
//#if MC<11400
|
||||
//#if FABRIC<=0
|
||||
//#if MC>=11300
|
||||
//$$ @Mod(ReplayMod.MOD_ID)
|
||||
//#else
|
||||
@@ -114,7 +118,7 @@ import static com.replaymod.core.versions.MCVer.*;
|
||||
//#endif
|
||||
//#endif
|
||||
public class ReplayMod implements
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
ClientModInitializer,
|
||||
//#endif
|
||||
Module
|
||||
@@ -299,7 +303,7 @@ public class ReplayMod implements
|
||||
//#endif
|
||||
}}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
modules.forEach(Module::initCommon);
|
||||
@@ -470,10 +474,12 @@ public class ReplayMod implements
|
||||
return mcThread;
|
||||
}
|
||||
|
||||
//#if FABRIC>=1
|
||||
@Override
|
||||
public void send(Runnable runnable) {
|
||||
method_18858(runnable);
|
||||
}
|
||||
//#endif
|
||||
|
||||
@Override
|
||||
public void executeTaskQueue() {
|
||||
@@ -573,7 +579,7 @@ public class ReplayMod implements
|
||||
//#endif
|
||||
|
||||
public String getVersion() {
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
return FabricLoader.getInstance().getModContainer(MOD_ID)
|
||||
.orElseThrow(IllegalStateException::new)
|
||||
.getMetadata().getVersion().toString();
|
||||
|
||||
@@ -13,7 +13,7 @@ import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
//#else
|
||||
@@ -28,13 +28,13 @@ import static com.replaymod.core.versions.MCVer.getMinecraft;
|
||||
public class GuiBackgroundProcesses extends EventRegistrations {
|
||||
private GuiPanel panel = new GuiPanel().setLayout(new VerticalLayout().setSpacing(10));
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(InitScreenCallback.EVENT, (screen, buttons) -> onGuiInit(screen)); }
|
||||
private void onGuiInit(Screen guiScreen) {
|
||||
//#else
|
||||
//$$ @SubscribeEvent
|
||||
//$$ public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
//$$ net.minecraft.client.gui.GuiScreen guiScreen = getGui(event);
|
||||
//$$ net.minecraft.client.gui.screen.Screen guiScreen = getGui(event);
|
||||
//#endif
|
||||
if (guiScreen != getMinecraft().currentScreen) return; // people tend to construct GuiScreens without opening them
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
package com.replaymod.core.gui;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
|
||||
@@ -12,29 +12,33 @@ import java.util.List;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
|
||||
//#else
|
||||
//$$ import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
//$$ import net.minecraftforge.common.MinecraftForge;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.gui.GuiButton;
|
||||
//$$ import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
//$$ import net.minecraftforge.common.MinecraftForge;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Moves certain buttons on the main menu upwards so we can inject our own.
|
||||
*/
|
||||
public class MainMenuHandler extends EventRegistrations {
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(InitScreenCallback.EVENT, this::onInit); }
|
||||
public void onInit(Screen guiScreen, List<AbstractButtonWidget> buttonList) {
|
||||
//#else
|
||||
//$$ @SubscribeEvent
|
||||
//$$ public void onInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
//$$ GuiScreen guiScreen = getGui(event);
|
||||
//$$ List<GuiButton> buttonList = getButtonList(event);
|
||||
//$$ Screen guiScreen = getGui(event);
|
||||
//$$ List<Widget> buttonList = getButtonList(event);
|
||||
//#endif
|
||||
if (guiScreen instanceof TitleScreen) {
|
||||
TitleScreen gui = (TitleScreen) guiScreen;
|
||||
|
||||
@@ -18,10 +18,11 @@ import net.minecraft.client.gui.Element;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public interface GuiScreenAccessor {
|
||||
@Accessor
|
||||
//#if MC>=11400
|
||||
@Accessor
|
||||
List<AbstractButtonWidget> getButtons();
|
||||
//#else
|
||||
//$$ @Accessor("buttonList")
|
||||
//$$ List<GuiButton> getButtons();
|
||||
//#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
package com.replaymod.core.mixin;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.replaymod.core.utils;
|
||||
import com.replaymod.replaystudio.data.ModInfo;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
@@ -32,7 +32,7 @@ public class ModCompat {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<ModInfo> getInstalledNetworkMods() {
|
||||
//#if MC>=11300
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
Map<String, ModInfo> modInfoMap = FabricLoader.getInstance().getAllMods().stream()
|
||||
.map(ModContainer::getMetadata)
|
||||
.map(m -> new ModInfo(m.getId(), m.getName(), m.getVersion().toString()))
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.replaymod.core.versions;
|
||||
import com.replaymod.core.mixin.GuiScreenAccessor;
|
||||
import com.replaymod.core.mixin.MinecraftAccessor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.client.render.Tessellator;
|
||||
@@ -24,14 +23,21 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11400
|
||||
import com.replaymod.core.mixin.AbstractButtonWidgetAccessor;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
//#else
|
||||
//$$ import com.google.common.util.concurrent.FutureCallback;
|
||||
//$$ import com.google.common.util.concurrent.Futures;
|
||||
//$$ import com.google.common.util.concurrent.ListenableFuture;
|
||||
//$$ import net.minecraft.entity.EntityLivingBase;
|
||||
//$$ import net.minecraft.client.gui.GuiButton;
|
||||
//#endif
|
||||
|
||||
//#if FABRIC>=1
|
||||
//#else
|
||||
//$$ import net.minecraft.entity.LivingEntity;
|
||||
//$$ import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
//$$ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
//$$ import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
@@ -80,9 +86,8 @@ import net.minecraft.client.render.chunk.ChunkRenderTask;
|
||||
//$$ import static org.lwjgl.opengl.GL11.*;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.SharedConstants;
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//$$ import net.minecraftforge.fml.ModList;
|
||||
@@ -104,7 +109,7 @@ import java.util.function.Consumer;
|
||||
public class MCVer {
|
||||
private static Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
//#if MC<11400
|
||||
//#if FABRIC<=0
|
||||
//$$ public static IEventBus FORGE_BUS = MinecraftForge.EVENT_BUS;
|
||||
//#if MC>=10809
|
||||
//$$ public static IEventBus FML_BUS = FORGE_BUS;
|
||||
@@ -114,7 +119,7 @@ public class MCVer {
|
||||
//#endif
|
||||
|
||||
public static boolean isModLoaded(String id) {
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
return FabricLoader.getInstance().isModLoaded(id.toLowerCase());
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
@@ -171,7 +176,24 @@ public class MCVer {
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
//#if MC<11400
|
||||
//#if FABRIC<=0
|
||||
//#if MC>=11400
|
||||
//$$ public static void addButton(GuiScreenEvent.InitGuiEvent event, Widget button) {
|
||||
//$$ event.addWidget(button);
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public static void removeButton(GuiScreenEvent.InitGuiEvent event, Widget button) {
|
||||
//$$ event.removeWidget(button);
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public static List<Widget> getButtonList(GuiScreenEvent.InitGuiEvent event) {
|
||||
//$$ return event.getWidgetList();
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public static Widget getButton(GuiScreenEvent.ActionPerformedEvent event) {
|
||||
//$$ return event.getButton();
|
||||
//$$ }
|
||||
//#else
|
||||
//$$ public static void addButton(GuiScreenEvent.InitGuiEvent event, GuiButton button) {
|
||||
//#if MC>=11300
|
||||
//$$ event.addButton(button);
|
||||
@@ -204,8 +226,9 @@ public class MCVer {
|
||||
//$$ return event.button;
|
||||
//#endif
|
||||
//$$ }
|
||||
//#endif
|
||||
//$$
|
||||
//$$ public static GuiScreen getGui(GuiScreenEvent event) {
|
||||
//$$ public static Screen getGui(GuiScreenEvent event) {
|
||||
//#if MC>=10904
|
||||
//$$ return event.getGui();
|
||||
//#else
|
||||
@@ -213,7 +236,7 @@ public class MCVer {
|
||||
//#endif
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public static EntityLivingBase getEntity(RenderLivingEvent event) {
|
||||
//$$ public static LivingEntity getEntity(RenderLivingEvent event) {
|
||||
//#if MC>=10904
|
||||
//$$ return event.getEntity();
|
||||
//#else
|
||||
@@ -234,7 +257,7 @@ public class MCVer {
|
||||
//#endif
|
||||
}
|
||||
|
||||
//#if MC<11400
|
||||
//#if FABRIC<=0
|
||||
//$$ public static RenderGameOverlayEvent.ElementType getType(RenderGameOverlayEvent event) {
|
||||
//#if MC>=10904
|
||||
//$$ return event.getType();
|
||||
@@ -475,7 +498,14 @@ public class MCVer {
|
||||
return ((MinecraftAccessor) getMinecraft()).getTimer().tickDelta;
|
||||
}
|
||||
|
||||
public static void addButton(Screen screen, ButtonWidget button) {
|
||||
public static void addButton(
|
||||
Screen screen,
|
||||
//#if MC>=11400
|
||||
ButtonWidget button
|
||||
//#else
|
||||
//$$ GuiButton button
|
||||
//#endif
|
||||
) {
|
||||
GuiScreenAccessor acc = (GuiScreenAccessor) screen;
|
||||
//#if MC>=11400
|
||||
if (screen instanceof TitleScreen && isModLoaded("modmenu")) {
|
||||
@@ -635,9 +665,8 @@ public class MCVer {
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
@SuppressWarnings("unused")
|
||||
public static abstract class Keyboard {
|
||||
//#if MC>=11300
|
||||
public static final int KEY_LCONTROL = GLFW.GLFW_KEY_LEFT_CONTROL;
|
||||
public static final int KEY_LSHIFT = GLFW.GLFW_KEY_LEFT_SHIFT;
|
||||
public static final int KEY_ESCAPE = GLFW.GLFW_KEY_ESCAPE;
|
||||
@@ -678,14 +707,69 @@ public class MCVer {
|
||||
public static final int KEY_X = GLFW.GLFW_KEY_X;
|
||||
public static final int KEY_Y = GLFW.GLFW_KEY_Y;
|
||||
public static final int KEY_Z = GLFW.GLFW_KEY_Z;
|
||||
//#else
|
||||
//$$ public static final int KEY_LCONTROL = org.lwjgl.input.Keyboard.KEY_LCONTROL;
|
||||
//$$ public static final int KEY_LSHIFT = org.lwjgl.input.Keyboard.KEY_LSHIFT;
|
||||
//$$ public static final int KEY_ESCAPE = org.lwjgl.input.Keyboard.KEY_ESCAPE;
|
||||
//$$ public static final int KEY_HOME = org.lwjgl.input.Keyboard.KEY_HOME;
|
||||
//$$ public static final int KEY_END = org.lwjgl.input.Keyboard.KEY_END;
|
||||
//$$ public static final int KEY_UP = org.lwjgl.input.Keyboard.KEY_UP;
|
||||
//$$ public static final int KEY_DOWN = org.lwjgl.input.Keyboard.KEY_DOWN;
|
||||
//$$ public static final int KEY_LEFT = org.lwjgl.input.Keyboard.KEY_LEFT;
|
||||
//$$ public static final int KEY_RIGHT = org.lwjgl.input.Keyboard.KEY_RIGHT;
|
||||
//$$ public static final int KEY_BACK = org.lwjgl.input.Keyboard.KEY_BACK;
|
||||
//$$ public static final int KEY_DELETE = org.lwjgl.input.Keyboard.KEY_DELETE;
|
||||
//$$ public static final int KEY_RETURN = org.lwjgl.input.Keyboard.KEY_RETURN;
|
||||
//$$ public static final int KEY_TAB = org.lwjgl.input.Keyboard.KEY_TAB;
|
||||
//$$ public static final int KEY_F1 = org.lwjgl.input.Keyboard.KEY_F1;
|
||||
//$$ public static final int KEY_A = org.lwjgl.input.Keyboard.KEY_A;
|
||||
//$$ public static final int KEY_B = org.lwjgl.input.Keyboard.KEY_B;
|
||||
//$$ public static final int KEY_C = org.lwjgl.input.Keyboard.KEY_C;
|
||||
//$$ public static final int KEY_D = org.lwjgl.input.Keyboard.KEY_D;
|
||||
//$$ public static final int KEY_E = org.lwjgl.input.Keyboard.KEY_E;
|
||||
//$$ public static final int KEY_F = org.lwjgl.input.Keyboard.KEY_F;
|
||||
//$$ public static final int KEY_G = org.lwjgl.input.Keyboard.KEY_G;
|
||||
//$$ public static final int KEY_H = org.lwjgl.input.Keyboard.KEY_H;
|
||||
//$$ public static final int KEY_I = org.lwjgl.input.Keyboard.KEY_I;
|
||||
//$$ public static final int KEY_J = org.lwjgl.input.Keyboard.KEY_J;
|
||||
//$$ public static final int KEY_K = org.lwjgl.input.Keyboard.KEY_K;
|
||||
//$$ public static final int KEY_L = org.lwjgl.input.Keyboard.KEY_L;
|
||||
//$$ public static final int KEY_M = org.lwjgl.input.Keyboard.KEY_M;
|
||||
//$$ public static final int KEY_N = org.lwjgl.input.Keyboard.KEY_N;
|
||||
//$$ public static final int KEY_O = org.lwjgl.input.Keyboard.KEY_O;
|
||||
//$$ public static final int KEY_P = org.lwjgl.input.Keyboard.KEY_P;
|
||||
//$$ public static final int KEY_Q = org.lwjgl.input.Keyboard.KEY_Q;
|
||||
//$$ public static final int KEY_R = org.lwjgl.input.Keyboard.KEY_R;
|
||||
//$$ public static final int KEY_S = org.lwjgl.input.Keyboard.KEY_S;
|
||||
//$$ public static final int KEY_T = org.lwjgl.input.Keyboard.KEY_T;
|
||||
//$$ public static final int KEY_U = org.lwjgl.input.Keyboard.KEY_U;
|
||||
//$$ public static final int KEY_V = org.lwjgl.input.Keyboard.KEY_V;
|
||||
//$$ public static final int KEY_W = org.lwjgl.input.Keyboard.KEY_W;
|
||||
//$$ public static final int KEY_X = org.lwjgl.input.Keyboard.KEY_X;
|
||||
//$$ public static final int KEY_Y = org.lwjgl.input.Keyboard.KEY_Y;
|
||||
//$$ public static final int KEY_Z = org.lwjgl.input.Keyboard.KEY_Z;
|
||||
//#endif
|
||||
|
||||
public static boolean isKeyDown(int keyCode) {
|
||||
//#if MC>=11400
|
||||
return InputUtil.isKeyPressed(getMinecraft().window.getHandle(), keyCode);
|
||||
//#else
|
||||
//#if MC>=11300
|
||||
//$$ return InputMappings.isKeyDown(keyCode);
|
||||
//#else
|
||||
//$$ return org.lwjgl.input.Keyboard.isKeyDown(keyCode);
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
//#if MC<11300
|
||||
//$$ public static int getEventKey() {
|
||||
//$$ return org.lwjgl.input.Keyboard.getEventKey();
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public static boolean getEventKeyState() {
|
||||
//$$ return org.lwjgl.input.Keyboard.getEventKeyState();
|
||||
//$$ }
|
||||
//#endif
|
||||
}
|
||||
//#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user