diff options
38 files changed, 147 insertions, 274 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a631b218..a6178a097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,164 +1 @@ -View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/1.14/CHANGELOG.md). -## v2.9+build.112 -- Fixed: ConcurrentModificationException crash in opening all recipes -- Fixed: Defaulted cheating command to `minecraft:give` instead of `give` -- Fixed: Can't cheat a stack of items on servers -- Fixed [#88](https://github.com/shedaniel/RoughlyEnoughItems/issues/88): Stupid Item Search -## v2.9+build.111 -- Added: Buttons to switch category page in original recipe viewing screen -- Updated: Mappings to 1.14.1 -## v2.9+build.110 -- Fixed: Build 109 Crash -- Fixed: Next Page / Previous Page crash in villager recipe mode -- Added: Scrolling in villager recipe mode -- Added: New bad javadoc: https://shedaniel.me/RoughlyEnoughItems/ -#### v2.9-beta+build.109 (BETA) -- Fixed [#92](https://github.com/shedaniel/RoughlyEnoughItems/issues/92): Make REI Buttons use an extra sheet -- Adds: Support for `{item_name}` in cheating items for getting the path of the item identifier -#### v2.9-beta+build.108 (BETA) -- Fixed [#88](https://github.com/shedaniel/RoughlyEnoughItems/issues/88): Stupid Item Search -#### v2.9-beta+build.107 (BETA) -- Fixed: Crashing when clicking tabs -- Added: Buttons to switch category page -- Fixed: NullPointerException by geniii -- Fixed [#58](https://github.com/shedaniel/RoughlyEnoughItems/issues/58): Keybinds (e.g. O, R, U) working even a search field is focused -#### v2.9-beta+build.106 (BETA) -- Using: [HammerLib](https://minecraft.curseforge.com/projects/hammer-lib) as a simple opengl scissors api -- New: Mod Name of category new shows in category tooltips -- New: Renderer API -- New: Villager Trading Like Recipe Screen.  -- New: Recipe Screen Selection Screen -- Removed: All `Locale.ROOT` usage -- Fixed: Button Width Rendering issues when the width is an odd number -- Changed: Mod Name changed from `RoughlyEnoughItems` to `Roughly Enough Items` -- Changed: Lots of internal refractors -- Fixed: Enchanting books not showing its maximum level -## v2.8.2+build.104 -- Fixed [#81](https://github.com/shedaniel/RoughlyEnoughItems/issues/81): Scrolling unaffected by exclusion zones. -- Added [#82](https://github.com/shedaniel/RoughlyEnoughItems/issues/82): Close search after pressing "Enter" -- Added [#83](https://github.com/shedaniel/RoughlyEnoughItems/issues/83): 2 More keybinds -## v2.8.1+build.103 -- Fixed: Item Searching Layering -- Added: Some tooltips in the config -- Fixed [#58](https://github.com/shedaniel/RoughlyEnoughItems/issues/58): Keybinds (e.g. O, R, U) working even creative search field is focused -## v2.8.1+build.102 -- Fixed: Server incorrect permission check -- Fixed: Base Bounds not correctly resizing -- Improved: Search Field -- Added: Right Click for Item Searching  -## v2.8.1+build.101 -- Updated [#77](https://github.com/shedaniel/RoughlyEnoughItems/pull/77): Updated Simplified Chinese by XuyuEre -- Updated: Updated Traditional Chinese by XuyuEre & Danielshe -- New: Better Exclusion Zone Handling -## v2.8.0+build.100 -- Fixed [#76](https://github.com/shedaniel/RoughlyEnoughItems/issues/76): Laggy Changing Pages -- New: Better Server Support (You can now drop REI into server mods) -- New: Better Cheat Mode Button -## v2.7.11.97 -- Fixed [#72](https://github.com/shedaniel/RoughlyEnoughItems/issues/72): Crash on clicking craftable items filter -- New: Load REI Plugins via entry points, old way works too but support will be dropped -- Removed: 'Enable Legacy Plugin Support' Option -## v2.7.10.96 -- Fixed [#69](https://github.com/shedaniel/RoughlyEnoughItems/issues/69): Weird Search Field -## v2.7.10.95 -- Fixed [#67](https://github.com/shedaniel/RoughlyEnoughItems/issues/67): Item Panel Crashes -## v2.7.9.94 -- Added: Support for `c` namespace ([Cotton](https://github.com/CottonMC/cotton) Common Resources) -- Added: Warping around the recipe book:  -- Fixed [#66](https://github.com/shedaniel/RoughlyEnoughItems/issues/66): Tooltips can be out of bounds -## v2.7.8.93 -- Fixed: Some localisations having broken json -- Fixed: Depth of Craftable Toggle Button -## v2.7.8.92 -- Modified: Bundled with updated API for pre3 -- Added: Option for Light Gray Recipe Border (I guess JEI like? I am going to get killed by mezz) -- Modified: Rearranged Config Screen -## v2.7.7.91 -- Updated: Chinese Localisation -## v2.7.6.90 -- Fixed [#63](https://github.com/shedaniel/RoughlyEnoughItems/issues/63): Pressing Space in the search bar opens the Config GUI -- Added [#64](https://github.com/shedaniel/RoughlyEnoughItems/issues/64): Option to flip give amount -## v2.7.5.89 -- Fixed: Keybinds (e.g. O, R, U) working even if recipe book search field is focused -## v2.7.4.88 -- Fixed: Item List Overlay buttons still enabled when there is only 1 page -- Fixed [#58](https://github.com/shedaniel/RoughlyEnoughItems/issues/58): Keybinds (e.g. O, R, U) working even if creative search field is focused -- Fixed [#59](https://github.com/shedaniel/RoughlyEnoughItems/issues/59): Wrong page calculation (Thanks geniiii) -## v2.7.3.87 -- Fixed: Credits button not working -- ~~Fixed: Keybinds (e.g. O, R, U) working even creative search field is focused~~ -## v2.7.3.86 -- Fixed [#56](https://github.com/shedaniel/RoughlyEnoughItems/issues/56): Even tho I don't know how I fixed it -- Added: Credits button in Config Screen -- Fixed: Odd pixel with the recipe screen -- Fixed: Pressing R not working on the side panel while viewing recipes -- Modified: Right-clicking the search field now focus it -- Fixed: Craftable Only button having a weird tint when something else is focused -- Added: Recipes now sort base on their identifiers -## v2.7.2.85 -- Bundled with updated APIs for 1.14-pre1 -- New DisplayHelper for better bounds calculation -## v2.7.1.84 -- Bundled with updated APIs. Fixed crash. -## v2.7.0.83 -- Updated to Fabric Loader 0.4.0 -- Now bundled with Fabric API, Cloth Events API, Cloth Config API -## v2.6.2.81 -- Fix [#53](https://github.com/shedaniel/RoughlyEnoughItems/issues/53): Crash on keyPressed -## v2.6.2.80 -- Updated to 19w14b -## v2.6.1.79 -- 75% less mixins -- Updated to 19w14a -## v2.6.0.78 -- Added config to force enable april fools -- Fix crash related to `getTotalPage()` -- Fix depth on overlay -- Less mixins -## v2.6.0.77 -- fish (April Fools [Download](https://minecraft.curseforge.com/projects/roughly-enough-items/files/2693786)) -## v2.6.0.76 -- New DisplayVisibilityHandler -- Fixed [#49](https://github.com/shedaniel/RoughlyEnoughItems/issues/49): REI Overlay added twice -## v2.5.1.75 -- Using Cloth events instead of overwriting methods \o/ (Please update [Cloth](https://minecraft.curseforge.com/projects/cloth)) -## v2.5.1.74 -- Updated to 19w13a -## v2.5.0.73 -- Made REI crash better (lmao wut) -## v2.5.0.72 -- Updated to 19w12b -## v2.5.0.71 -- Removed mouseScrolled Override in mixins -- Added spectator mode in gamemode switcher -- Gamemodes & Weather are now translatable: [#47](https://github.com/shedaniel/RoughlyEnoughItems/issues/47) -- Fixed Search Field -- Fixed Button Focus -- Added Button Tooltips -- Removed credits button (it will be back) -- Removed disabling credits option -- Update to 19w12a -- New config screen from [Cloth](https://minecraft.curseforge.com/projects/cloth) -## v2.4.2.68 -- Fixed [Cloth](https://minecraft.curseforge.com/projects/cloth) missing text -## v2.4.2.67 -- Fixed pages being weird -- Added Portuguese -## v2.4.2.66 -- Removed Mod Menu hooks, will hook into Mod Menu itself in the future -- Improved gui widgets -## v2.4.1.65 -- [Cloth](https://minecraft.curseforge.com/projects/cloth) is now required for REI to run -- Update to 19w11a -## v2.4.0.63 -- First implementation of [Cloth](https://minecraft.curseforge.com/projects/cloth), [Cloth](https://minecraft.curseforge.com/projects/cloth) is still not required for REI to boot but it will be a must have dependency when 19w11a comes. -- Used [Cloth](https://minecraft.curseforge.com/projects/cloth) for hooking up [Mod Menu](https://minecraft.curseforge.com/projects/modmenu/) config. Example: [https://streamable.com/ivbsj](https://streamable.com/ivbsj) -- Changed config `true / false` to `Yes / No` -## v2.4.0.61 -- Config with comments -- Fix creative inventory even more -- No longer uses Fabric internals -- Config to disable Recipe Book -- Fixes [Issue #27: Second page react as first page recipes](https://github.com/shedaniel/RoughlyEnoughItems/issues/27) -## v2.3.2.56 -- Removed Plugin Update Checker +View changelog [here](https://gist.github.com/shedaniel/b7593e692319976f3349263208792922). diff --git a/gradle.properties b/gradle.properties index 1e92112ae..698a6d821 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version=2.9 +mod_version=2.9.1 minecraft_version=1.14.1 yarn_version=1.14.1+build.10 fabricloader_version=0.4.7+build.147 diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java index e7d114548..32c74344a 100644 --- a/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/client/ClientHelperImpl.java @@ -24,6 +24,7 @@ import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; +import net.minecraft.ChatFormat; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.client.util.InputUtil; @@ -58,7 +59,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer { String mod = getModFromItem(item); if (mod.equalsIgnoreCase("")) return ""; - return "§9§o" + mod; + return ChatFormat.BLUE.toString() + ChatFormat.ITALIC.toString() + mod; } @Override @@ -66,7 +67,7 @@ public class ClientHelperImpl implements ClientHelper, ClientModInitializer { String mod = getModFromIdentifier(identifier); if (mod.equalsIgnoreCase("")) return ""; - return "§9§o" + mod; + return ChatFormat.BLUE.toString() + ChatFormat.ITALIC.toString() + mod; } @Override diff --git a/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java index bfceee51c..8aeeb7c59 100644 --- a/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java @@ -15,13 +15,14 @@ import me.shedaniel.rei.client.ScreenHelper; import me.shedaniel.rei.gui.widget.ButtonWidget; import me.shedaniel.rei.gui.widget.HighlightableWidget; import me.shedaniel.rei.gui.widget.Widget; +import net.minecraft.ChatFormat; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.GuiLighting; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; -import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; @@ -39,7 +40,7 @@ public class PreRecipeViewingScreen extends Screen { private Map<RecipeCategory, List<RecipeDisplay>> map; public PreRecipeViewingScreen(Map<RecipeCategory, List<RecipeDisplay>> map) { - super(new TextComponent("text.rei.recipe_screen_type.selection")); + super(new TranslatableComponent("text.rei.recipe_screen_type.selection")); this.widgets = Lists.newArrayList(); this.original = true; this.map = map; @@ -72,7 +73,7 @@ public class PreRecipeViewingScreen extends Screen { this.drawCenteredString(this.font, this.title.getFormattedText(), this.width / 2, 20, 16777215); int i = 30; for(String s : this.font.wrapStringToWidthAsList(I18n.translate("text.rei.recipe_screen_type.selection.sub"), width - 30)) { - this.drawCenteredString(this.font, "§7" + s, width / 2, i, -1); + this.drawCenteredString(this.font, ChatFormat.GRAY.toString() + s, width / 2, i, -1); i += 10; } super.render(int_1, int_2, float_1); diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index 1b59cc1f7..468c3b734 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -14,6 +14,7 @@ import me.shedaniel.rei.api.*; import me.shedaniel.rei.client.ScreenHelper; import me.shedaniel.rei.gui.renderables.RecipeRenderer; import me.shedaniel.rei.gui.widget.*; +import net.minecraft.ChatFormat; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.screen.Screen; @@ -172,7 +173,7 @@ public class VillagerRecipeViewingScreen extends Screen { @Override public void render(int mouseX, int mouseY, float delta) { GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); - font.draw((isHovered(mouseX, mouseY) ? "§n" : "") + text, x - font.getStringWidth(text) / 2, y, getDefaultColor()); + font.draw((isHovered(mouseX, mouseY) ? ChatFormat.UNDERLINE.toString() : "") + text, x - font.getStringWidth(text) / 2, y, getDefaultColor()); if (clickable && getTooltips().isPresent()) if (!focused && isHighlighted(mouseX, mouseY)) ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); diff --git a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java index ac396b7e4..d07c5c7c7 100644 --- a/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java @@ -5,18 +5,37 @@ package me.shedaniel.rei.gui.credits; +import me.shedaniel.clothconfig.gui.DynamicSmoothScrollingEntryListWidget; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget; +import net.minecraft.client.gui.DrawableHelper; import net.minecraft.network.chat.Component; -public class CreditsEntryListWidget extends AlwaysSelectedEntryListWidget<CreditsEntryListWidget.CreditsItem> { +public class CreditsEntryListWidget extends DynamicSmoothScrollingEntryListWidget<CreditsEntryListWidget.CreditsItem> { - public CreditsEntryListWidget(MinecraftClient client, int width, int height, int startY, int endY, int entryHeight) { - super(client, width, height, startY, endY, entryHeight); + private boolean inFocus; + + public CreditsEntryListWidget(MinecraftClient client, int width, int height, int startY, int endY) { + super(client, width, height, startY, endY, DrawableHelper.BACKGROUND_LOCATION); + } + + @Override + public boolean changeFocus(boolean boolean_1) { + if (!this.inFocus && this.getItemCount() == 0) { + return false; + } else { + this.inFocus = !this.inFocus; + if (this.inFocus && this.getFocused() == null && this.getItemCount() > 0) { + this.moveSelection(1); + } else if (this.inFocus && this.getFocused() != null) { + this.moveSelection(0); + } + + return this.inFocus; + } } public void creditsClearEntries() { - clearEntries(); + clearItems(); } private CreditsItem rei_getEntry(int int_1) { @@ -24,11 +43,11 @@ public class CreditsEntryListWidget extends AlwaysSelectedEntryListWidget<Credit } public void creditsAddEntry(CreditsItem entry) { - addEntry(entry); + addItem(entry); } @Override - public int getRowWidth() { + public int getItemWidth() { return width - 80; } @@ -37,7 +56,7 @@ public class CreditsEntryListWidget extends AlwaysSelectedEntryListWidget<Credit return width - 40; } - public static class CreditsItem extends AlwaysSelectedEntryListWidget.Entry<CreditsItem> { + public static class CreditsItem extends DynamicSmoothScrollingEntryListWidget.Entry<CreditsItem> { private String text; public CreditsItem(Component textComponent) { @@ -52,6 +71,16 @@ public class CreditsEntryListWidget extends AlwaysSelectedEntryListWidget<Credit public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) { MinecraftClient.getInstance().textRenderer.drawWithShadow(text, x + 5, y + 5, -1); } + + @Override + public int getItemHeight() { + return 12; + } + + @Override + public boolean changeFocus(boolean boolean_1) { + return false; + } } } diff --git a/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java b/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java index ab96765fa..f80f5c662 100644 --- a/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java @@ -37,7 +37,7 @@ public class CreditsScreen extends Screen { @Override protected void init() { - children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32, 12)); + children.add(entryListWidget = new CreditsEntryListWidget(minecraft, width, height, 32, height - 32)); entryListWidget.creditsClearEntries(); for(String line : I18n.translate("text.rei.credit.text").split("\n")) entryListWidget.creditsAddEntry(new CreditsItem(new TextComponent(line))); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java index 8a6ccdc76..c6c18f4bf 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java @@ -6,6 +6,7 @@ package me.shedaniel.rei.gui.widget; import me.shedaniel.rei.client.ScreenHelper; +import net.minecraft.ChatFormat; import java.awt.*; import java.util.Optional; @@ -30,7 +31,7 @@ public abstract class ClickableLabelWidget extends LabelWidget { int colour = getDefaultColor(); if (clickable && isHovered(mouseX, mouseY)) colour = getHoveredColor(); - drawCenteredString(font, (isHovered(mouseX, mouseY) ? "§n" : "") + text, x, y, colour); + drawCenteredString(font, (isHovered(mouseX, mouseY) ? ChatFormat.UNDERLINE.toString() : "") + text, x, y, colour); if (clickable && getTooltips().isPresent()) if (!focused && isHighlighted(mouseX, mouseY)) ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java index 1d65feb3f..3b71c7f12 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java @@ -104,6 +104,7 @@ public class RecipeChoosePageWidget extends DraggableWidget { String endString = String.format(" /%d", maxPage); int width = font.getStringWidth(endString); this.widgets.add(textFieldWidget = new TextFieldWidget(bounds.x + 7, bounds.y + 16, bounds.width - width - 12, 18)); + textFieldWidget.setMaxLength(10000); textFieldWidget.stripInvaild = s -> { StringBuilder stringBuilder_1 = new StringBuilder(); char[] var2 = s.toCharArray(); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java index 7291de999..72f380052 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java @@ -17,6 +17,7 @@ public class SearchFieldWidget extends TextFieldWidget { public SearchFieldWidget(int x, int y, int width, int height) { super(x, y, width, height); + setMaxLength(10000); } public void laterRender(int int_1, int int_2, float float_1) { diff --git a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java index 2ae47fca2..c4ac02342 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java @@ -10,7 +10,7 @@ import me.shedaniel.rei.api.ClientHelper; import me.shedaniel.rei.api.RecipeCategory; import me.shedaniel.rei.api.Renderer; import me.shedaniel.rei.client.ScreenHelper; -import me.shedaniel.rei.gui.RecipeViewingScreen; +import net.minecraft.ChatFormat; import net.minecraft.client.render.GuiLighting; import net.minecraft.util.Identifier; @@ -84,7 +84,7 @@ public class TabWidget extends HighlightableWidget { private void drawTooltip() { if (this.minecraft.options.advancedItemTooltips) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, "§8" + category.getIdentifier().toString(), ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier()))); + ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ChatFormat.DARK_GRAY.toString() + category.getIdentifier().toString(), ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier()))); else ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(categoryName, ClientHelper.getInstance().getFormattedModFromIdentifier(category.getIdentifier()))); } diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java index 3ae946fee..e1ab4c9ed 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java @@ -13,6 +13,7 @@ import me.shedaniel.rei.gui.renderables.RecipeRenderer; import me.shedaniel.rei.gui.widget.RecipeBaseWidget; import me.shedaniel.rei.gui.widget.SlotWidget; import me.shedaniel.rei.gui.widget.Widget; +import net.minecraft.ChatFormat; import net.minecraft.block.Blocks; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.GuiLighting; @@ -23,6 +24,7 @@ import net.minecraft.util.math.MathHelper; import java.awt.*; import java.util.Arrays; +import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; @@ -74,7 +76,7 @@ public class DefaultBlastingCategory implements RecipeCategory<DefaultBlastingDi widgets.add(new SlotWidget(startPoint.x + 1, startPoint.y + 37, recipeDisplay.getFuel(), true, true, true) { @Override protected List<String> getExtraToolTips(ItemStack stack) { - return Arrays.asList(I18n.translate("category.rei.smelting.fuel")); + return Collections.singletonList(ChatFormat.YELLOW.toString() + I18n.translate("category.rei.smelting.fuel")); } }); widgets.add(new SlotWidget(startPoint.x + 61, startPoint.y + 19, recipeDisplay.getOutput(), false, true, true)); diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingDisplay.java index 4b88d9e7e..3adab1d6f 100644 --- a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingDisplay.java @@ -5,7 +5,6 @@ package me.shedaniel.rei.plugin; -import com.google.common.collect.Lists; import me.shedaniel.rei.api.RecipeDisplay; import net.minecraft.block.entity.FurnaceBlockEntity; import net.minecraft.item.Item; @@ -13,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.recipe.BlastingRecipe; import net.minecraft.util.Identifier; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -26,8 +26,8 @@ public class DefaultBlastingDisplay implements RecipeDisplay<BlastingRecipe> { public DefaultBlastingDisplay(BlastingRecipe recipe) { this.display = recipe; - this.input = Lists.newArrayList(recipe.getPreviewInputs().stream().map(i -> Lists.newArrayList(i.getStackArray())).collect(Collectors.toList())); - input.add(FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getDefaultStack).collect(Collectors.toList())); + this.input = recipe.getPreviewInputs().stream().map(i -> Arrays.asList(i.getStackArray())).collect(Collectors.toList()); + this.input.add(FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getDefaultStack).collect(Collectors.toList())); this.output = Collections.singletonList(recipe.getOutput()); } |
