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

Commit

Permalink
🗑️Remove "Hide JEI until search" feature , issue #3 ,TeamDeusVult/Mag…
Browse files Browse the repository at this point in the history
…nesiumExtras issue txnimc#26
  • Loading branch information
TexBlock committed Aug 2, 2022
1 parent bb8733e commit ba76de1
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 74 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ dependencies {
//runtimeOnly fg.deobf("curse.maven:oculus-581495:3770744")
runtimeOnly fg.deobf("curse.maven:create-328085:3737418")
runtimeOnly fg.deobf("curse.maven:flywheel-486392:3737402")
implementation fg.deobf("curse.maven:jei-238222:3758750")
// implementation fg.deobf("curse.maven:jei-238222:3758750")

annotationProcessor 'org.spongepowered:mixin:0.8.3:processor'
}
Expand Down
Binary file added build/libs/rubidium_extras-1.18.2_v1.3.3-i18n.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon = false

# mod version info
mod_id = rubidium_extras
mod_version = 1.3.2-i18n-Hotfix3
mod_version = 1.3.3-i18n
minecraft_version = 1.18.2
forge_version = 40.1.0
mappings_version=1.18.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MagnesiumExtrasConfig
public static ConfigValue<Boolean> fog;
public static ConfigValue<Boolean> enableDistanceChecks;

public static ConfigValue<Boolean> hideJEI;
// public static ConfigValue<Boolean> hideJEI;

// Ok Zoomer
public static ZoomValues zoomValues = new ZoomValues();
Expand Down Expand Up @@ -74,7 +74,7 @@ public class MagnesiumExtrasConfig
cloudHeight = b.define("Cloud Height [Raw, Default 256]", 256);
fadeInQuality = b.define("Chunk Fade In Quality (OFF, FAST, FANCY)", "FANCY");
fog = b.define("Render Fog", true);
hideJEI = b.define("Hide JEI Until Searching", true);
// hideJEI = b.define("Hide JEI Until Searching", true);
fullScreenMode = b.defineEnum("Use Borderless Fullscreen", FullscreenMode.FULLSCREEN);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
package vice.rubidium_extras.mixins.JEI;

import com.mojang.blaze3d.vertex.PoseStack;
import mezz.jei.api.gui.handlers.IGuiProperties;
import mezz.jei.gui.elements.GuiIconToggleButton;
import mezz.jei.gui.overlay.IngredientListOverlay;
import mezz.jei.input.GuiTextFieldFilter;
import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import vice.rubidium_extras.config.MagnesiumExtrasConfig;

@Mixin(value = IngredientListOverlay.class, remap = false)
public class IngredientListOverlayMixin
{
@Shadow
@Final
private GuiTextFieldFilter searchField;

@Shadow private IGuiProperties guiProperties;

@Shadow @Final private GuiIconToggleButton configButton;

@Inject(cancellable = true,
at = @At(value = "INVOKE", target = "Lmezz/jei/gui/overlay/IngredientGridWithNavigation;draw(Lnet/minecraft/client/Minecraft;Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V"),
method = "drawScreen")
public void render(Minecraft minecraft, PoseStack poseStack, int mouseX, int mouseY, float partialTicks, CallbackInfo ci)
{
if (!MagnesiumExtrasConfig.hideJEI.get())
return;

String value = searchField.getValue();
if (value.equals("")) {
if (guiProperties != null) {
configButton.draw(poseStack, mouseX, mouseY, partialTicks);
}
ci.cancel();
}
}

@Inject(cancellable = true,
at = @At(value = "HEAD"),
method = "drawTooltips")
public void render(Minecraft minecraft, PoseStack poseStack, int mouseX, int mouseY, CallbackInfo ci)
{
if (!MagnesiumExtrasConfig.hideJEI.get())
return;

String value = searchField.getValue();
if (value.equals("")) {
ci.cancel();
}
}
}
//import com.mojang.blaze3d.vertex.PoseStack;
//import mezz.jei.api.gui.handlers.IGuiProperties;
//import mezz.jei.gui.elements.GuiIconToggleButton;
//import mezz.jei.gui.overlay.IngredientListOverlay;
//import mezz.jei.input.GuiTextFieldFilter;
//import net.minecraft.client.Minecraft;
//import org.spongepowered.asm.mixin.Final;
//import org.spongepowered.asm.mixin.Mixin;
//import org.spongepowered.asm.mixin.Shadow;
//import org.spongepowered.asm.mixin.injection.At;
//import org.spongepowered.asm.mixin.injection.Inject;
//import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//import vice.rubidium_extras.config.MagnesiumExtrasConfig;

//@Mixin(value = IngredientListOverlay.class, remap = false)
//public class IngredientListOverlayMixin
//{
// @Shadow
// @Final
// private GuiTextFieldFilter searchField;
//
// @Shadow private IGuiProperties guiProperties;
//
// @Shadow @Final private GuiIconToggleButton configButton;
//
// @Inject(cancellable = true,
// at = @At(value = "INVOKE", target = "Lmezz/jei/gui/overlay/IngredientGridWithNavigation;draw(Lnet/minecraft/client/Minecraft;Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V"),
// method = "drawScreen")
// public void render(Minecraft minecraft, PoseStack poseStack, int mouseX, int mouseY, float partialTicks, CallbackInfo ci)
// {
// if (!MagnesiumExtrasConfig.hideJEI.get())
// return;
//
// String value = searchField.getValue();
// if (value.equals("")) {
// if (guiProperties != null) {
// configButton.draw(poseStack, mouseX, mouseY, partialTicks);
// }
// ci.cancel();
// }
// }
//
// @Inject(cancellable = true,
// at = @At(value = "HEAD"),
// method = "drawTooltips")
// public void render(Minecraft minecraft, PoseStack poseStack, int mouseX, int mouseY, CallbackInfo ci)
// {
// if (!MagnesiumExtrasConfig.hideJEI.get())
// return;
//
// String value = searchField.getValue();
// if (value.equals("")) {
// ci.cancel();
// }
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ private static void Inject(CallbackInfoReturnable<OptionPage> cir, List<OptionGr
.setImpact(OptionImpact.LOW)
.build();

OptionImpl<SodiumGameOptions, Boolean> hideJEI = OptionImpl.createBuilder(Boolean.class, sodiumOpts)
.setName(Component.nullToEmpty(I18n.get("rb_extra.hide_jei_until_searching.name")))
.setTooltip(Component.nullToEmpty(I18n.get("rb_extra.hide_jei_until_searching.tooltip")))
.setControl(TickBoxControl::new)
.setBinding(
(options, value) -> MagnesiumExtrasConfig.hideJEI.set(value),
(options) -> MagnesiumExtrasConfig.hideJEI.get())
.setImpact(OptionImpact.LOW)
.build();
// OptionImpl<SodiumGameOptions, Boolean> hideJEI = OptionImpl.createBuilder(Boolean.class, sodiumOpts)
// .setName(Component.nullToEmpty(I18n.get("rb_extra.hide_jei_until_searching.name")))
// .setTooltip(Component.nullToEmpty(I18n.get("rb_extra.hide_jei_until_searching.tooltip")))
// .setControl(TickBoxControl::new)
// .setBinding(
// (options, value) -> MagnesiumExtrasConfig.hideJEI.set(value),
// (options) -> MagnesiumExtrasConfig.hideJEI.get())
// .setImpact(OptionImpact.LOW)
// .build();

OptionImpl<SodiumGameOptions, Integer> cloudHeight = OptionImpl.createBuilder(Integer.TYPE, sodiumOpts)
.setName(Component.nullToEmpty(I18n.get("rb_extra.cloud_height.name")))
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/assets/rubidium_extras/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
"rb_extra.cloud_height.tooltip": "Raises cloud height.",
"rb_extra.fog.name": "Enable fog",
"rb_extra.fog.tooltip": "Toggles off all fog in the overworld.",
"rb_extra.hide_jei_until_searching.name": "Hide JEI Until Searching",
"rb_extra.hide_jei_until_searching.tooltip": "Toggles off JEI items unless you search for something. Press space to search for everything.",
"rb_extra.full_screen_mode.name": "Fullscreen Mode",
"rb_extra.full_screen_mode.tooltip": "Windowed - the game will display in a small window.\nBorderless - the game will be fullscreened, and locked to your monitor's refresh rate, but allow you to tab out easily.\nFullscreen - the game will display in native fullscreen mode.",

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/assets/rubidium_extras/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
"rb_extra.cloud_height.tooltip": "提高云层高度。",
"rb_extra.fog.name": "启用雾",
"rb_extra.fog.tooltip": "关掉主世界所有的雾。",
"rb_extra.hide_jei_until_searching.name": "在搜索前隐藏JEI",
"rb_extra.hide_jei_until_searching.tooltip": "关闭JEI物品,除非你搜索到什么。按空格键可以搜索所有东西。",
"rb_extra.full_screen_mode.name": "全屏模式",
"rb_extra.full_screen_mode.tooltip": "窗口 - 游戏将在一个小窗口中显示。\n无边框 - 游戏将是全屏的,并锁定在你的显示器的刷新率上,但允许你轻松地退出。\n全屏 - 游戏将以原版全屏模式显示。",

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/rubidium_extras.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"refmap": "rubidium_extras.refmap.json",
"mixins": [
"fog.MixinSodiumWorldRenderer",
"JEI.IngredientListOverlayMixin",
"SodiumConfig.SodiumGameOptionsMixin",
"Zoom.PlayerInventoryMixin"
],
Expand Down

0 comments on commit ba76de1

Please sign in to comment.