Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
修正 JEI 兼容问题
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Feb 2, 2019
1 parent 6a1cd91 commit b3733c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies {
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
deobfCompile "mezz.jei:jei_${minecraft.version}:4.8.5.147"
deobfCompile "mezz.jei:jei_${minecraft.version}:4.14.3.243"

// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime
shadow 'org.apache.httpcomponents:httpmime:4.3.3'
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/org/cfpa/i18nupdatemod/I18nConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.cfpa.i18nupdatemod.I18nUpdateMod;

@Config(modid = I18nUpdateMod.MODID, name = "i18n_update_mod", category = "i18n_mod")
public class I18nConfig {
Expand Down Expand Up @@ -39,7 +38,6 @@ public static class Notice {
}

public static class Download {

@Config.Name("启用非阻塞安装")
@Config.RequiresMcRestart
@Config.Comment("实验功能!")
Expand Down Expand Up @@ -93,11 +91,6 @@ public static class Key {
@Config.Comment("为腐竹设计,防止玩家乱改按键导致问题")
@Config.RequiresMcRestart
public Boolean closedKey = false;

@Config.Name("是否开启 JEI 兼容")
@Config.Comment("最近有玩家反馈 JEI 兼容问题,临时关闭")
@Config.RequiresMcRestart
public Boolean jeiKey = false;
}

public static class Internationalization {
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/cfpa/i18nupdatemod/I18nUpdateMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
import org.cfpa.i18nupdatemod.installer.ResourcePackInstallerBlocking;
import org.cfpa.i18nupdatemod.installer.ResourcePackInstallerNonBlocking;

import static org.cfpa.i18nupdatemod.I18nUtils.*;
import static org.cfpa.i18nupdatemod.I18nUtils.isChinese;
import static org.cfpa.i18nupdatemod.I18nUtils.setupLang;


@Mod(modid = I18nUpdateMod.MODID, name = I18nUpdateMod.NAME, clientSideOnly = true, acceptedMinecraftVersions = "[1.12]", version = I18nUpdateMod.VERSION, dependencies = "after:defaultoptions")
@Mod(
modid = I18nUpdateMod.MODID,
name = I18nUpdateMod.NAME,
clientSideOnly = true,
acceptedMinecraftVersions = "[1.12]",
version = I18nUpdateMod.VERSION,
dependencies = "after:defaultoptions"
)
public class I18nUpdateMod {
public final static String MODID = "i18nmod";
public final static String NAME = "I18n Update Mod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import org.apache.commons.io.IOUtils;
import org.cfpa.i18nupdatemod.I18nConfig;
import org.cfpa.i18nupdatemod.I18nUpdateMod;
import org.cfpa.i18nupdatemod.I18nUtils;
import org.cfpa.i18nupdatemod.I18nConfig;
import org.lwjgl.input.Keyboard;

import java.awt.*;
Expand Down Expand Up @@ -92,8 +92,11 @@ public void onKeyPress(GuiScreenEvent.KeyboardInputEvent.Pre e) {
}
}
// JEI 支持
if (Loader.isModLoaded("jei") && I18nConfig.key.jeiKey) {
showed = keyHandler(Internal.getRuntime().getIngredientListOverlay().getStackUnderMouse());
if (Loader.isModLoaded("jei")) {
try {
showed = keyHandler(Internal.getRuntime().getItemListOverlay().getStackUnderMouse());
} catch (Exception ept) {
}
}
}

Expand Down

0 comments on commit b3733c9

Please sign in to comment.