This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
forked from txnimc/MagnesiumExtras
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗑️Remove "Hide JEI until search" feature , issue #3 ,TeamDeusVult/Mag…
…nesiumExtras issue txnimc#26
- Loading branch information
Showing
9 changed files
with
69 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 56 additions & 56 deletions
112
src/main/java/vice/rubidium_extras/mixins/JEI/IngredientListOverlayMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters