Jelajahi Sumber

Update to pre3

Unknown 6 tahun lalu
induk
melakukan
8e1b0e5deb

+ 6 - 2
CHANGELOG.md

@@ -1,6 +1,10 @@
 View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/1.14/CHANGELOG.md).
+## 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
+- 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
@@ -66,7 +70,7 @@ View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/
 - 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 message
+- Fixed [Cloth](https://minecraft.curseforge.com/projects/cloth) missing text
 ## v2.4.2.67
 - Fixed pages being weird
 - Added Portuguese

+ 6 - 6
gradle.properties

@@ -1,9 +1,9 @@
-mod_version=2.7.7+build.91
-minecraft_version=1.14 Pre-Release 2
-yarn_version=1.14 Pre-Release 2+build.1
-fabric_version=0.2.7+build.122
-fabricloader_version=0.4.0+build.121
+mod_version=2.7.8+build.92
+minecraft_version=1.14 Pre-Release 3
+yarn_version=1.14 Pre-Release 3+build.1
+fabric_version=0.2.7+build.123
+fabricloader_version=0.4.1+build.126
 jankson_version=1.1.0
 cloth_events_version=0.3.1.23
-cloth_config_version=0.1.2.6
+cloth_config_version=0.1.3.7
 modmenu_version=1.3.0-52

+ 0 - 1
src/main/java/me/shedaniel/rei/api/ItemRegistry.java

@@ -9,7 +9,6 @@ public interface ItemRegistry {
     
     List<ItemStack> getItemList();
     
-    @Deprecated
     List<ItemStack> getModifiableItemList();
     
     ItemStack[] getAllStacksFromItem(Item item);

+ 3 - 1
src/main/java/me/shedaniel/rei/client/ConfigObject.java

@@ -54,7 +54,9 @@ public class ConfigObject {
     
     public ItemCheatingMode itemCheatingMode = ItemCheatingMode.REI_LIKE;
     
-    @Comment("The location of choose page dialog")
+    public boolean lightGrayRecipeBorder = false;
+    
+    @Comment("The location of choose page dialog, will automatically be set to your last location so there is no need to change this.")
     public RelativePoint choosePageDialogPoint = new RelativePoint(.5, .5);
     
 }

+ 0 - 1
src/main/java/me/shedaniel/rei/client/ItemRegistryImpl.java

@@ -21,7 +21,6 @@ public class ItemRegistryImpl implements ItemRegistry {
         return Collections.unmodifiableList(itemList);
     }
     
-    @Deprecated
     @Override
     public List<ItemStack> getModifiableItemList() {
         return itemList;

+ 2 - 2
src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java

@@ -285,7 +285,7 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
     }
     
     private GameMode getCurrentGameMode() {
-        return MinecraftClient.getInstance().getNetworkHandler().getScoreboardEntry(MinecraftClient.getInstance().player.getGameProfile().getId()).getGameMode();
+        return MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(MinecraftClient.getInstance().player.getGameProfile().getId()).getGameMode();
     }
     
     private Rectangle getTextFieldArea() {
@@ -333,7 +333,7 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
         ScreenHelper.searchField.laterRender(mouseX, mouseY, delta);
         Screen currentScreen = MinecraftClient.getInstance().currentScreen;
         if (!(currentScreen instanceof RecipeViewingScreen) || !((RecipeViewingScreen) currentScreen).choosePageActivated)
-            QUEUED_TOOLTIPS.stream().filter(Objects::nonNull).forEach(queuedTooltip -> renderTooltip(queuedTooltip.getText(), queuedTooltip.getLocation().x, queuedTooltip.getLocation().y));
+            QUEUED_TOOLTIPS.stream().filter(Objects::nonNull).forEach(queuedTooltip -> renderTooltip(queuedTooltip.getText(), queuedTooltip.getX(), queuedTooltip.getY()));
         QUEUED_TOOLTIPS.clear();
     }
     

+ 1 - 1
src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java

@@ -33,7 +33,7 @@ public class CreditsEntryListWidget extends AlwaysSelectedItemListWidget<Credits
         return width - 40;
     }
     
-    public static class CreditsItem extends AlwaysSelectedItemListWidget.class_4281<CreditsItem> {
+    public static class CreditsItem extends AlwaysSelectedItemListWidget.Item<CreditsItem> {
         private String text;
         
         public CreditsItem(TextComponent textComponent) {

+ 8 - 0
src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java

@@ -38,6 +38,14 @@ public class QueuedTooltip {
         return location;
     }
     
+    public int getX() {
+        return getLocation().x;
+    }
+    
+    public int getY() {
+        return getLocation().y;
+    }
+    
     public List<String> getText() {
         return text;
     }

+ 2 - 1
src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java

@@ -1,6 +1,7 @@
 package me.shedaniel.rei.gui.widget;
 
 import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import net.minecraft.client.render.GuiLighting;
 import net.minecraft.util.Identifier;
 
@@ -64,7 +65,7 @@ public class RecipeBaseWidget extends HighlightableWidget {
     }
     
     protected int getTextureOffset() {
-        return 0;
+        return RoughlyEnoughItemsCore.getConfigManager().getConfig().lightGrayRecipeBorder ? 0 : 66;
     }
     
     

+ 0 - 23
src/main/java/me/shedaniel/rei/utils/ClientWeatherUtils.java

@@ -1,23 +0,0 @@
-package me.shedaniel.rei.utils;
-
-public class ClientWeatherUtils {
-    
-    private float rain = 0f, thunder = 0f;
-    
-    public float getRain() {
-        return rain;
-    }
-    
-    public void setRain(float rain) {
-        this.rain = rain;
-    }
-    
-    public float getThunder() {
-        return thunder;
-    }
-    
-    public void setThunder(float thunder) {
-        this.thunder = thunder;
-    }
-    
-}

+ 16 - 28
src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java

@@ -6,6 +6,7 @@ import me.shedaniel.cloth.gui.entries.BooleanListEntry;
 import me.shedaniel.cloth.gui.entries.EnumListEntry;
 import me.shedaniel.cloth.gui.entries.IntegerSliderEntry;
 import me.shedaniel.cloth.gui.entries.StringListEntry;
+import me.shedaniel.cloth.hooks.ScreenHooks;
 import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.ItemCheatingMode;
 import me.shedaniel.rei.gui.config.ItemListOrderingConfig;
@@ -23,32 +24,13 @@ import java.util.Map;
 public class ClothScreenRegistry {
     
     public static void openConfigScreen(Screen parent) {
-        ConfigScreenBuilder builder = new ClothConfigScreen.Builder(parent, "text.rei.config.title", savedConfig -> {
+        ConfigScreenBuilder builder = ConfigScreenBuilder.create(parent, "text.rei.config.title", savedConfig -> {
             try {
                 RoughlyEnoughItemsCore.getConfigManager().saveConfig();
             } catch (IOException e) {
                 e.printStackTrace();
             }
-        }) {
-            @Override
-            public ClothConfigScreen build() {
-                return new ClothConfigScreen(this.getParentScreen(), this.getTitle(), this.getDataMap(), this.doesConfirmSave(), this.shouldProcessErrors()) {
-                    public void onSave(Map<String, List<Pair<String, Object>>> o) {
-                        if (getOnSave() != null) {
-                            getOnSave().accept(new SelfSavedConfig(o));
-                        }
-                    }
-                    
-                    @Override
-                    protected void init() {
-                        super.init();
-                        ButtonWidget w;
-                        buttons.add(0, w = new ButtonWidget(6, 6, 60, 20, I18n.translate("text.rei.credits"), widget -> MinecraftClient.getInstance().openScreen(new CreditsScreen(MinecraftClient.getInstance().currentScreen))));
-                        children.add(0, w);
-                    }
-                };
-            }
-        };
+        });
         builder.addCategory("text.rei.config.general").addOption(new BooleanListEntry("text.rei.config.cheating", RoughlyEnoughItemsCore.getConfigManager().getConfig().cheating, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().cheating = bool));
         ConfigScreenBuilder.CategoryBuilder appearance = builder.addCategory("text.rei.config.appearance");
         appearance.addOption(new BooleanListEntry("text.rei.config.side_search_box", RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField = bool));
@@ -63,22 +45,28 @@ public class ClothScreenRegistry {
             }
         });
         appearance.addOption(new IntegerSliderEntry("text.rei.config.max_recipes_per_page", 2, 99, RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage, "text.cloth-config.reset_value", () -> 3, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage = i));
-        appearance.addOption(new EnumListEntry<>("text.rei.config.item_cheating_mode", ItemCheatingMode.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode, "text.cloth-config.reset_value", () -> ItemCheatingMode.REI_LIKE, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode = i, anEnum -> {
-            return I18n.translate("text.rei.config.item_cheating_mode." + anEnum.name().toLowerCase());
+        appearance.addOption(new BooleanListEntry("text.rei.config.light_gray_recipe_border", RoughlyEnoughItemsCore.getConfigManager().getConfig().lightGrayRecipeBorder, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().lightGrayRecipeBorder = bool));
+        appearance.addOption(new BooleanListEntry("text.rei.config.prefer_visible_recipes", RoughlyEnoughItemsCore.getConfigManager().getConfig().preferVisibleRecipes, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().preferVisibleRecipes = bool));
+        ConfigScreenBuilder.CategoryBuilder action = builder.addCategory("text.rei.config.action");
+        action.addOption(new EnumListEntry<>("text.rei.config.item_cheating_mode", ItemCheatingMode.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode, "text.cloth-config.reset_value", () -> ItemCheatingMode.REI_LIKE, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode = i, e -> {
+            return I18n.translate("text.rei.config.item_cheating_mode." + e.name().toLowerCase());
         }));
+        action.addOption(new StringListEntry("text.rei.give_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand, "text.cloth-config.reset_value", () -> "/give {player_name} {item_identifier}{nbt} {count}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand = s));
+        action.addOption(new StringListEntry("text.rei.gamemode_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand, "text.cloth-config.reset_value", () -> "/gamemode {gamemode}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand = s));
+        action.addOption(new StringListEntry("text.rei.weather_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand, "text.cloth-config.reset_value", () -> "/weather {weather}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand = s));
         ConfigScreenBuilder.CategoryBuilder modules = builder.addCategory("text.rei.config.modules");
         modules.addOption(new BooleanListEntry("text.rei.config.enable_craftable_only", RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton, "text.cloth-config.reset_value", () -> true, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().enableCraftableOnlyButton = bool));
         modules.addOption(new BooleanListEntry("text.rei.config.enable_util_buttons", RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().showUtilsButtons = bool));
         modules.addOption(new BooleanListEntry("text.rei.config.disable_recipe_book", RoughlyEnoughItemsCore.getConfigManager().getConfig().disableRecipeBook, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().disableRecipeBook = bool));
         ConfigScreenBuilder.CategoryBuilder advanced = builder.addCategory("text.rei.config.advanced");
-        advanced.addOption(new StringListEntry("text.rei.give_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand, "text.cloth-config.reset_value", () -> "/give {player_name} {item_identifier}{nbt} {count}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().giveCommand = s));
-        advanced.addOption(new StringListEntry("text.rei.gamemode_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand, "text.cloth-config.reset_value", () -> "/gamemode {gamemode}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().gamemodeCommand = s));
-        advanced.addOption(new StringListEntry("text.rei.weather_command", RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand, "text.cloth-config.reset_value", () -> "/weather {weather}", s -> RoughlyEnoughItemsCore.getConfigManager().getConfig().weatherCommand = s));
-        advanced.addOption(new BooleanListEntry("text.rei.config.prefer_visible_recipes", RoughlyEnoughItemsCore.getConfigManager().getConfig().preferVisibleRecipes, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().preferVisibleRecipes = bool));
         advanced.addOption(new BooleanListEntry("text.rei.config.enable_legacy_speedcraft_support", RoughlyEnoughItemsCore.getConfigManager().getConfig().enableLegacySpeedCraftSupport, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().enableLegacySpeedCraftSupport = bool));
         ConfigScreenBuilder.CategoryBuilder aprilFools = builder.addCategory("text.rei.config.april_fools");
         aprilFools.addOption(new BooleanListEntry("text.rei.config.april_fools.2019", RoughlyEnoughItemsCore.getConfigManager().getConfig().aprilFoolsFish2019, "text.cloth-config.reset_value", () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().aprilFoolsFish2019 = bool));
-        MinecraftClient.getInstance().openScreen(builder.build());
+        MinecraftClient.getInstance().openScreen(builder.build(screen -> {
+            ButtonWidget w = new ButtonWidget(6, 6, 60, 20, I18n.translate("text.rei.credits"), widget -> MinecraftClient.getInstance().openScreen(new CreditsScreen(MinecraftClient.getInstance().currentScreen)));
+            ((ScreenHooks) screen).cloth_getButtonWidgets().add(0, w);
+            ((ScreenHooks) screen).cloth_getChildren().add(0, w);
+        }));
     }
     
     private static class SelfSavedConfig extends ClothConfigScreen.Builder.SavedConfig {

+ 2 - 0
src/main/resources/assets/roughlyenoughitems/lang/en_us.json

@@ -4,6 +4,7 @@
   "key.roughlyenoughitems.hide_keybind": "Hide/Show REI",
   "key.roughlyenoughitems.usage_keybind": "Show Uses",
   "text.rei.config.general": "General",
+  "text.rei.config.action": "Action",
   "text.rei.config.cheating": "Cheating:",
   "text.rei.cheating": "Cheating",
   "category.rei.crafting": "Crafting",
@@ -82,6 +83,7 @@
   "text.rei.config.item_cheating_mode": "Item Cheating Amount:",
   "text.rei.config.item_cheating_mode.rei_like": "Normal",
   "text.rei.config.item_cheating_mode.jei_like": "Reversed",
+  "text.rei.config.light_gray_recipe_border": "Light Gray Recipe Border:",
   "text.rei.no_config_api": "Cloth Config API does not exist!\nPlease install it in order to show an in-game config screen!",
   "_comment": "Don't change / translate the credit down below if you are doing it :)",
   "text.rei.credit.text": "§lRoughly Enough Items\n§7Originally a fork for Almost Enough Items.\n\n§lDevelopers\n  - Originally by ZenDarva\n  - Created by Danielshe\n  - Plugin Support by TehNut\n\n§lLanguage Translation\n  English - Danielshe\n  Simplified Chinese - Danielshe\n  Traditional Chinese - hugoalh, gxy17886 & Danielshe\n  French - Yanis48\n  German - MelanX\n  Estonian - Madis0\n  Portuguese - thiagokenis\n  LOLCAT - Danielshe\n  Upside Down - Danielshe\n  Brazilian Portuguese - thiagokenis\n  Bulgarian - geniiii\n\n§lLicense\n§7Roughly Enough Items is using MIT."

TEMPAT SAMPAH
src/main/resources/assets/roughlyenoughitems/textures/gui/recipecontainer.png