diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2024-02-26 20:01:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 20:01:25 +0100 |
| commit | 8f32281cc06aa933507965db2d07605b9f245a27 (patch) | |
| tree | 58fc38a49777667158a668e2aac244dc94392d79 /src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | |
| parent | ce557a70d776926ceee3d43f0ccf7b34bc97fe31 (diff) | |
| download | notenoughupdates-8f32281cc06aa933507965db2d07605b9f245a27.tar.gz notenoughupdates-8f32281cc06aa933507965db2d07605b9f245a27.tar.bz2 notenoughupdates-8f32281cc06aa933507965db2d07605b9f245a27.zip | |
Added option to open the skyblock recipe menu with a keybind (#1029)
* Added option to open the skyblock recipe menu with a keybind
* Use streams to find crafting recipe
---------
Co-authored-by: Linnea Gräf <nea@nea.moe>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 87b08ef7..797260c4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -38,12 +38,14 @@ import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import io.github.moulberry.notenoughupdates.miscfeatures.SunTzu; import io.github.moulberry.notenoughupdates.miscgui.NeuSearchCalculator; import io.github.moulberry.notenoughupdates.miscgui.pricegraph.GuiPriceGraph; +import io.github.moulberry.notenoughupdates.recipes.CraftingRecipe; import io.github.moulberry.notenoughupdates.util.Calculator; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.GuiTextures; import io.github.moulberry.notenoughupdates.util.LerpingFloat; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.SpecialColour; +import io.github.moulberry.notenoughupdates.util.StreamExtL; import io.github.moulberry.notenoughupdates.util.Utils; import lombok.var; import net.minecraft.client.Minecraft; @@ -742,8 +744,7 @@ public class NEUOverlay extends Gui { if (NotEnoughUpdates.INSTANCE.config.itemlist.wikiInBrowser) { Utils.openUrl(infoText); Utils.addChatMessage("§e[NEU] Opening webpage in browser."); - } - else { + } else { displayInformationPane(new TextInfoPane( this, manager, @@ -1232,6 +1233,21 @@ public class NEUOverlay extends Gui { } else { NotEnoughUpdates.INSTANCE.trySendCommand("/bz " + cleanName); } + } else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.openSkyBlockRecipeKeybind + && !item.has("vanilla") + && StreamExtL.filterIsInstance( + manager.getAvailableRecipesFor(internalname.get()).stream(), + CraftingRecipe.class + ) + .findAny() + .isPresent() + ) { + String displayName = Utils.cleanColour(item + .get("displayname") + .getAsString() + .replace("[Lvl {LVL}]", "") + .trim()); + NotEnoughUpdates.INSTANCE.trySendCommand("/recipe " + displayName); } } } |
