Bladeren bron

Fix bugs + translation

Unknown 5 jaren geleden
bovenliggende
commit
798dd97844

+ 1 - 0
src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java

@@ -269,6 +269,7 @@ public class VillagerRecipeViewingScreen extends Screen {
             scroll = MathHelper.clamp(scroll, 0, height - scrollListBounds.height + 2);
             scroll = MathHelper.clamp(scroll, 0, height - scrollListBounds.height + 2);
             if (scrollBarAlphaFuture == 0)
             if (scrollBarAlphaFuture == 0)
                 scrollBarAlphaFuture = 1f;
                 scrollBarAlphaFuture = 1f;
+            if (System.currentTimeMillis() - scrollBarAlphaFutureTime > 300f)
             scrollBarAlphaFutureTime = System.currentTimeMillis();
             scrollBarAlphaFutureTime = System.currentTimeMillis();
             return true;
             return true;
         }
         }

+ 0 - 5
src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java

@@ -32,11 +32,6 @@ public class DefaultAutoCraftingPlugin implements REIPluginV0 {
         if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) {
         if (!RoughlyEnoughItemsCore.getConfigManager().getConfig().isLoadingDefaultPlugin()) {
             return;
             return;
         }
         }
-        //        recipeHelper.registerAutoCraftingHandler(new AutoCraftingTableBookHandler());
-        //        recipeHelper.registerAutoCraftingHandler(new AutoInventoryBookHandler());
-        //        recipeHelper.registerAutoCraftingHandler(new AutoFurnaceBookHandler());
-        //        recipeHelper.registerAutoCraftingHandler(new AutoSmokerBookHandler());
-        //        recipeHelper.registerAutoCraftingHandler(new AutoBlastingBookHandler());
         recipeHelper.registerAutoCraftingHandler(new DefaultCategoryHandler());
         recipeHelper.registerAutoCraftingHandler(new DefaultCategoryHandler());
     }
     }
 }
 }

+ 0 - 35
src/main/java/me/shedaniel/rei/plugin/autocrafting/AutoBlastingBookHandler.java

@@ -1,35 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.plugin.autocrafting;
-
-import me.shedaniel.rei.api.AutoTransferHandler;
-import me.shedaniel.rei.impl.ScreenHelper;
-import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
-import me.shedaniel.rei.plugin.blasting.DefaultBlastingDisplay;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.BlastFurnaceScreen;
-import net.minecraft.container.BlastFurnaceContainer;
-
-public class AutoBlastingBookHandler implements AutoTransferHandler {
-    @Override
-    public Result handle(Context context) {
-        if (!(context.getContainerScreen() instanceof BlastFurnaceScreen) || !(context.getRecipe() instanceof DefaultBlastingDisplay))
-            return Result.createNotApplicable();
-        if (!((DefaultBlastingDisplay) context.getRecipe()).getOptionalRecipe().isPresent() || !context.getMinecraft().player.getRecipeBook().contains(((DefaultBlastingDisplay) context.getRecipe()).getOptionalRecipe().get()))
-            return Result.createNotApplicable();
-        if (!context.isActuallyCrafting())
-            return Result.createSuccessful();
-        
-        DefaultBlastingDisplay display = (DefaultBlastingDisplay) context.getRecipe();
-        BlastFurnaceScreen furnaceScreen = (BlastFurnaceScreen) context.getContainerScreen();
-        context.getMinecraft().openScreen(furnaceScreen);
-        ((RecipeBookGuiHooks) furnaceScreen.getRecipeBookGui()).rei_getGhostSlots().reset();
-        BlastFurnaceContainer container = furnaceScreen.getContainer();
-        context.getMinecraft().interactionManager.clickRecipe(container.syncId, display.getOptionalRecipe().get(), Screen.hasShiftDown());
-        ScreenHelper.getLastOverlay().init();
-        return Result.createSuccessful();
-    }
-}

+ 0 - 35
src/main/java/me/shedaniel/rei/plugin/autocrafting/AutoCraftingTableBookHandler.java

@@ -1,35 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.plugin.autocrafting;
-
-import me.shedaniel.rei.api.AutoTransferHandler;
-import me.shedaniel.rei.impl.ScreenHelper;
-import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
-import me.shedaniel.rei.plugin.crafting.DefaultCraftingDisplay;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.CraftingTableScreen;
-import net.minecraft.container.CraftingTableContainer;
-
-public class AutoCraftingTableBookHandler implements AutoTransferHandler {
-    @Override
-    public Result handle(Context context) {
-        if (!(context.getContainerScreen() instanceof CraftingTableScreen) || !(context.getRecipe() instanceof DefaultCraftingDisplay))
-            return Result.createNotApplicable();
-        if (!((DefaultCraftingDisplay) context.getRecipe()).getOptionalRecipe().isPresent() || !context.getMinecraft().player.getRecipeBook().contains(((DefaultCraftingDisplay) context.getRecipe()).getOptionalRecipe().get()))
-            return Result.createNotApplicable();
-        if (!context.isActuallyCrafting())
-            return Result.createSuccessful();
-        
-        DefaultCraftingDisplay display = (DefaultCraftingDisplay) context.getRecipe();
-        CraftingTableScreen craftingTableScreen = (CraftingTableScreen) context.getContainerScreen();
-        context.getMinecraft().openScreen(craftingTableScreen);
-        ((RecipeBookGuiHooks) craftingTableScreen.getRecipeBookGui()).rei_getGhostSlots().reset();
-        CraftingTableContainer container = craftingTableScreen.getContainer();
-        context.getMinecraft().interactionManager.clickRecipe(container.syncId, display.getOptionalRecipe().get(), Screen.hasShiftDown());
-        ScreenHelper.getLastOverlay().init();
-        return Result.createSuccessful();
-    }
-}

+ 0 - 35
src/main/java/me/shedaniel/rei/plugin/autocrafting/AutoFurnaceBookHandler.java

@@ -1,35 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.plugin.autocrafting;
-
-import me.shedaniel.rei.api.AutoTransferHandler;
-import me.shedaniel.rei.impl.ScreenHelper;
-import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
-import me.shedaniel.rei.plugin.smelting.DefaultSmeltingDisplay;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.FurnaceScreen;
-import net.minecraft.container.FurnaceContainer;
-
-public class AutoFurnaceBookHandler implements AutoTransferHandler {
-    @Override
-    public Result handle(Context context) {
-        if (!(context.getContainerScreen() instanceof FurnaceScreen) || !(context.getRecipe() instanceof DefaultSmeltingDisplay))
-            return Result.createNotApplicable();
-        if (!((DefaultSmeltingDisplay) context.getRecipe()).getOptionalRecipe().isPresent() || !context.getMinecraft().player.getRecipeBook().contains(((DefaultSmeltingDisplay) context.getRecipe()).getOptionalRecipe().get()))
-            return Result.createNotApplicable();
-        if (!context.isActuallyCrafting())
-            return Result.createSuccessful();
-        
-        DefaultSmeltingDisplay display = (DefaultSmeltingDisplay) context.getRecipe();
-        FurnaceScreen furnaceScreen = (FurnaceScreen) context.getContainerScreen();
-        context.getMinecraft().openScreen(furnaceScreen);
-        ((RecipeBookGuiHooks) furnaceScreen.getRecipeBookGui()).rei_getGhostSlots().reset();
-        FurnaceContainer container = furnaceScreen.getContainer();
-        context.getMinecraft().interactionManager.clickRecipe(container.syncId, display.getOptionalRecipe().get(), Screen.hasShiftDown());
-        ScreenHelper.getLastOverlay().init();
-        return Result.createSuccessful();
-    }
-}

+ 0 - 37
src/main/java/me/shedaniel/rei/plugin/autocrafting/AutoInventoryBookHandler.java

@@ -1,37 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.plugin.autocrafting;
-
-import me.shedaniel.rei.api.AutoTransferHandler;
-import me.shedaniel.rei.impl.ScreenHelper;
-import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
-import me.shedaniel.rei.plugin.crafting.DefaultCraftingDisplay;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.InventoryScreen;
-import net.minecraft.container.PlayerContainer;
-
-public class AutoInventoryBookHandler implements AutoTransferHandler {
-    @Override
-    public Result handle(Context context) {
-        if (!(context.getContainerScreen() instanceof InventoryScreen) || !(context.getRecipe() instanceof DefaultCraftingDisplay))
-            return Result.createNotApplicable();
-        if (!((DefaultCraftingDisplay) context.getRecipe()).getOptionalRecipe().isPresent() || !context.getMinecraft().player.getRecipeBook().contains(((DefaultCraftingDisplay) context.getRecipe()).getOptionalRecipe().get()))
-            return Result.createNotApplicable();
-        if (((DefaultCraftingDisplay) context.getRecipe()).getWidth() > 2 || ((DefaultCraftingDisplay) context.getRecipe()).getHeight() > 2)
-            return Result.createFailed("error.rei.transfer.too_small");
-        if (!context.isActuallyCrafting())
-            return Result.createSuccessful();
-        
-        DefaultCraftingDisplay display = (DefaultCraftingDisplay) context.getRecipe();
-        InventoryScreen inventoryScreen = (InventoryScreen) context.getContainerScreen();
-        context.getMinecraft().openScreen(inventoryScreen);
-        ((RecipeBookGuiHooks) inventoryScreen.getRecipeBookGui()).rei_getGhostSlots().reset();
-        PlayerContainer container = inventoryScreen.getContainer();
-        context.getMinecraft().interactionManager.clickRecipe(container.syncId, display.getOptionalRecipe().get(), Screen.hasShiftDown());
-        ScreenHelper.getLastOverlay().init();
-        return Result.createSuccessful();
-    }
-}

+ 0 - 35
src/main/java/me/shedaniel/rei/plugin/autocrafting/AutoSmokerBookHandler.java

@@ -1,35 +0,0 @@
-/*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
-
-package me.shedaniel.rei.plugin.autocrafting;
-
-import me.shedaniel.rei.api.AutoTransferHandler;
-import me.shedaniel.rei.impl.ScreenHelper;
-import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
-import me.shedaniel.rei.plugin.smoking.DefaultSmokingDisplay;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.SmokerScreen;
-import net.minecraft.container.SmokerContainer;
-
-public class AutoSmokerBookHandler implements AutoTransferHandler {
-    @Override
-    public Result handle(Context context) {
-        if (!(context.getContainerScreen() instanceof SmokerScreen) || !(context.getRecipe() instanceof DefaultSmokingDisplay))
-            return Result.createNotApplicable();
-        if (!((DefaultSmokingDisplay) context.getRecipe()).getOptionalRecipe().isPresent() || !context.getMinecraft().player.getRecipeBook().contains(((DefaultSmokingDisplay) context.getRecipe()).getOptionalRecipe().get()))
-            return Result.createNotApplicable();
-        if (!context.isActuallyCrafting())
-            return Result.createSuccessful();
-        
-        DefaultSmokingDisplay display = (DefaultSmokingDisplay) context.getRecipe();
-        SmokerScreen smokerScreen = (SmokerScreen) context.getContainerScreen();
-        context.getMinecraft().openScreen(smokerScreen);
-        ((RecipeBookGuiHooks) smokerScreen.getRecipeBookGui()).rei_getGhostSlots().reset();
-        SmokerContainer container = smokerScreen.getContainer();
-        context.getMinecraft().interactionManager.clickRecipe(container.syncId, display.getOptionalRecipe().get(), Screen.hasShiftDown());
-        ScreenHelper.getLastOverlay().init();
-        return Result.createSuccessful();
-    }
-}

+ 1 - 5
src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java

@@ -44,11 +44,7 @@ public interface DefaultCraftingDisplay extends TransferRecipeDisplay {
         }
         }
         for (int i = 0; i < getInput().size(); i++) {
         for (int i = 0; i < getInput().size(); i++) {
             List<ItemStack> stacks = getInput().get(i);
             List<ItemStack> stacks = getInput().get(i);
-            if (this instanceof DefaultShapedDisplay) {
-                if (!stacks.isEmpty())
-                    list.set(DefaultCraftingCategory.getSlotWithSize(this, i), stacks);
-            } else if (!stacks.isEmpty())
-                list.set(i, stacks);
+            list.set(i, stacks);
         }
         }
         return list;
         return list;
     }
     }

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

@@ -117,7 +117,7 @@
   "config.roughlyenoughitems.registerRecipesInAnotherThread.boolean.true": "New REI Thread",
   "config.roughlyenoughitems.registerRecipesInAnotherThread.boolean.true": "New REI Thread",
   "config.roughlyenoughitems.registerRecipesInAnotherThread.boolean.false": "§cPacket Thread",
   "config.roughlyenoughitems.registerRecipesInAnotherThread.boolean.false": "§cPacket Thread",
   "config.roughlyenoughitems.weatherCommand": "Weather Command:",
   "config.roughlyenoughitems.weatherCommand": "Weather Command:",
-  "config.roughlyenoughitems.itemListOrdering": "Item List Ordering:",
+  "config.roughlyenoughitems.itemListOrdering": "Entry List Ordering:",
   "config.roughlyenoughitems.list_ordering_button": "%s [%s]",
   "config.roughlyenoughitems.list_ordering_button": "%s [%s]",
   "config.roughlyenoughitems.recipeScreenType": "Recipe Screen Type:",
   "config.roughlyenoughitems.recipeScreenType": "Recipe Screen Type:",
   "config.roughlyenoughitems.recipeScreenType.unset": "Not Set",
   "config.roughlyenoughitems.recipeScreenType.unset": "Not Set",
@@ -126,6 +126,9 @@
   "config.roughlyenoughitems.itemCheatingMode": "Item Cheating Amount:",
   "config.roughlyenoughitems.itemCheatingMode": "Item Cheating Amount:",
   "config.roughlyenoughitems.itemCheatingMode.rei_like": "Normal",
   "config.roughlyenoughitems.itemCheatingMode.rei_like": "Normal",
   "config.roughlyenoughitems.itemCheatingMode.jei_like": "Inverted",
   "config.roughlyenoughitems.itemCheatingMode.jei_like": "Inverted",
-  "config.roughlyenoughitems.appendModNames": "Append Mod Names",
+  "config.roughlyenoughitems.appendModNames": "Append Mod Names:",
+  "config.roughlyenoughitems.scrollingEntryListWidget": "Entry List Action:",
+  "config.roughlyenoughitems.scrollingEntryListWidget.boolean.true": "Scrolled",
+  "config.roughlyenoughitems.scrollingEntryListWidget.boolean.false": "Paginated",
   "text.rei.credit.text": "§lRoughly Enough Items (v%s)\n§7Originally a fork for Almost Enough Items.\n\n§lDevelopers\n  Originally by ZenDarva\n  Rewritten by Danielshe\n  Old Plugin Support by TehNut\n\n§lLanguage Translation\n%s\n\n§lLicense\n§7Roughly Enough Items is licensed with MIT."
   "text.rei.credit.text": "§lRoughly Enough Items (v%s)\n§7Originally a fork for Almost Enough Items.\n\n§lDevelopers\n  Originally by ZenDarva\n  Rewritten by Danielshe\n  Old Plugin Support by TehNut\n\n§lLanguage Translation\n%s\n\n§lLicense\n§7Roughly Enough Items is licensed with MIT."
 }
 }