Răsfoiți Sursa

Better Exclusion Zone API

Unknown 6 ani în urmă
părinte
comite
930388c938

+ 4 - 0
CHANGELOG.md

@@ -1,4 +1,8 @@
 View full changelog [here](https://github.com/shedaniel/RoughlyEnoughItems/blob/1.14/CHANGELOG.md).
+## 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)

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-mod_version=2.8.0+build.100
+mod_version=2.8.1+build.101
 minecraft_version=1.14
 yarn_version=1.14+build.5
 fabricloader_version=0.4.6+build.141

+ 16 - 0
src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java

@@ -0,0 +1,16 @@
+package me.shedaniel.rei.api;
+
+import net.minecraft.client.gui.Screen;
+
+import java.awt.*;
+import java.util.List;
+
+public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Screen> {
+    List<Rectangle> getCurrentExclusionZones(Class<? extends Screen> currentScreenClass, boolean isOnRightSide);
+    
+    void registerExclusionZones(Class<? extends Screen> screenClass, ExclusionZoneSupplier supplier);
+    
+    public static interface ExclusionZoneSupplier {
+        List<Rectangle> apply(boolean isOnRightSide);
+    }
+}

+ 6 - 0
src/main/java/me/shedaniel/rei/api/DisplayHelper.java

@@ -16,6 +16,8 @@ public interface DisplayHelper {
     
     void registerBoundsHandler(DisplayBoundsHandler handler);
     
+    BaseBoundsHandler getBaseBoundsHandler();
+    
     public static interface DisplayBoundsHandler<T> {
         Class getBaseSupportedClass();
         
@@ -31,6 +33,10 @@ public interface DisplayHelper {
             return new Rectangle(rectangle.x + 2, rectangle.y + 24, rectangle.width - 4, rectangle.height - (RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField ? 27 + 22 : 27));
         }
         
+        default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
+            return false;
+        }
+        
         default float getPriority() {
             return 0f;
         }

+ 93 - 0
src/main/java/me/shedaniel/rei/client/BaseBoundsHandlerImpl.java

@@ -0,0 +1,93 @@
+package me.shedaniel.rei.client;
+
+import com.google.common.collect.Lists;
+import me.shedaniel.rei.api.BaseBoundsHandler;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.Screen;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.Pair;
+
+import java.awt.*;
+import java.util.Comparator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+public class BaseBoundsHandlerImpl implements BaseBoundsHandler {
+    
+    private static final Function<Rectangle, String> RECTANGLE_STRING_FUNCTION = rectangle -> rectangle.x + "," + rectangle.y + "," + rectangle.width + "," + rectangle.height;
+    private static final Comparator<Rectangle> RECTANGLE_COMPARATOR = BaseBoundsHandlerImpl::compare;
+    private static final Comparator<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> LIST_PAIR_COMPARATOR;
+    
+    static {
+        Comparator<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> comparator = Comparator.comparingDouble(value -> value.getLeft().getRight());
+        LIST_PAIR_COMPARATOR = comparator.reversed();
+    }
+    
+    private String lastArea = null;
+    private List<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> list = Lists.newArrayList();
+    
+    private static int compare(Rectangle o1, Rectangle o2) {return RECTANGLE_STRING_FUNCTION.apply(o1).compareTo(RECTANGLE_STRING_FUNCTION.apply(o2));}
+    
+    @Override
+    public Class getBaseSupportedClass() {
+        return Screen.class;
+    }
+    
+    @Override
+    public Rectangle getLeftBounds(Screen screen) {
+        return new Rectangle();
+    }
+    
+    @Override
+    public Rectangle getRightBounds(Screen screen) {
+        return new Rectangle();
+    }
+    
+    @Override
+    public float getPriority() {
+        return -5f;
+    }
+    
+    @Override
+    public boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
+        if (lastArea == null) {
+            lastArea = getStringFromAreas(rectangle, getCurrentExclusionZones(MinecraftClient.getInstance().currentScreen.getClass(), isOnRightSide));
+            return false;
+        }
+        String fromAreas = getStringFromAreas(rectangle, getCurrentExclusionZones(MinecraftClient.getInstance().currentScreen.getClass(), isOnRightSide));
+        if (lastArea.contentEquals(fromAreas))
+            return false;
+        lastArea = fromAreas;
+        return true;
+    }
+    
+    @Override
+    public ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, Screen screen, Rectangle fullBounds) {
+        List<Rectangle> currentExclusionZones = getCurrentExclusionZones(MinecraftClient.getInstance().currentScreen.getClass(), isOnRightSide);
+        for(Rectangle currentExclusionZone : currentExclusionZones)
+            if (left + 18 >= currentExclusionZone.x && top + 18 >= currentExclusionZone.y && left <= currentExclusionZone.x + currentExclusionZone.width && top <= currentExclusionZone.y + currentExclusionZone.height)
+                return ActionResult.FAIL;
+        return ActionResult.PASS;
+    }
+    
+    public List<Rectangle> getCurrentExclusionZones(Class<? extends Screen> currentScreenClass, boolean isOnRightSide) {
+        List<Pair<Pair<Class<? extends Screen>, Float>, ExclusionZoneSupplier>> only = list.stream().filter(pair -> pair.getLeft().getLeft().isAssignableFrom(currentScreenClass)).collect(Collectors.toList());
+        only.sort(LIST_PAIR_COMPARATOR);
+        List<Rectangle> rectangles = Lists.newArrayList();
+        only.forEach(pair -> rectangles.addAll(pair.getRight().apply(isOnRightSide)));
+        return rectangles;
+    }
+    
+    @Override
+    public void registerExclusionZones(Class<? extends Screen> screenClass, ExclusionZoneSupplier supplier) {
+        list.add(new Pair<>(new Pair<>(screenClass, 0f), supplier));
+    }
+    
+    public String getStringFromAreas(Rectangle rectangle, List<Rectangle> exclusionZones) {
+        List<Rectangle> sorted = Lists.newArrayList(exclusionZones);
+        sorted.sort(RECTANGLE_COMPARATOR);
+        return RECTANGLE_STRING_FUNCTION.apply(rectangle) + ":" + sorted.stream().map(RECTANGLE_STRING_FUNCTION::apply).collect(Collectors.joining("|"));
+    }
+    
+}

+ 16 - 0
src/main/java/me/shedaniel/rei/client/DisplayHelperImpl.java

@@ -2,6 +2,7 @@ package me.shedaniel.rei.client;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import me.shedaniel.rei.api.BaseBoundsHandler;
 import me.shedaniel.rei.api.DisplayHelper;
 
 import java.awt.*;
@@ -33,9 +34,15 @@ public class DisplayHelperImpl implements DisplayHelper {
         public Rectangle getRightBounds(Object screen) {
             return new Rectangle();
         }
+        
+        @Override
+        public float getPriority() {
+            return -10f;
+        }
     };
     private List<DisplayBoundsHandler> screenDisplayBoundsHandlerMap = Lists.newArrayList();
     private Map<Class, DisplayBoundsHandler> handlerCache = Maps.newHashMap();
+    private BaseBoundsHandler baseBoundsHandler;
     
     @Override
     public List<DisplayBoundsHandler> getSortedBoundsHandlers(Class screenClass) {
@@ -59,6 +66,15 @@ public class DisplayHelperImpl implements DisplayHelper {
         screenDisplayBoundsHandlerMap.add(handler);
     }
     
+    @Override
+    public BaseBoundsHandler getBaseBoundsHandler() {
+        return baseBoundsHandler;
+    }
+    
+    public void setBaseBoundsHandler(BaseBoundsHandler baseBoundsHandler) {
+        this.baseBoundsHandler = baseBoundsHandler;
+    }
+    
     public void resetCache() {
         handlerCache.clear();
     }

+ 17 - 10
src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java

@@ -185,6 +185,9 @@ public class RecipeHelperImpl implements RecipeHelper {
         this.categoryDisplaySettingsMap.clear();
         this.displayVisibilityHandlers.clear();
         ((DisplayHelperImpl) RoughlyEnoughItemsCore.getDisplayHelper()).resetCache();
+        BaseBoundsHandler baseBoundsHandler = new BaseBoundsHandlerImpl();
+        RoughlyEnoughItemsCore.getDisplayHelper().registerBoundsHandler(baseBoundsHandler);
+        ((DisplayHelperImpl) RoughlyEnoughItemsCore.getDisplayHelper()).setBaseBoundsHandler(baseBoundsHandler);
         long startTime = System.currentTimeMillis();
         List<REIPluginEntry> plugins = new LinkedList<>(RoughlyEnoughItemsCore.getPlugins());
         plugins.sort((first, second) -> {
@@ -196,16 +199,20 @@ public class RecipeHelperImpl implements RecipeHelper {
         PluginDisabler pluginDisabler = RoughlyEnoughItemsCore.getPluginDisabler();
         plugins.forEach(plugin -> {
             Identifier identifier = plugin.getPluginIdentifier();
-            if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_ITEMS))
-                plugin.registerItems(RoughlyEnoughItemsCore.getItemRegisterer());
-            if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_CATEGORIES))
-                plugin.registerPluginCategories(this);
-            if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_RECIPE_DISPLAYS))
-                plugin.registerRecipeDisplays(this);
-            if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_BOUNDS))
-                plugin.registerBounds(RoughlyEnoughItemsCore.getDisplayHelper());
-            if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_OTHERS))
-                plugin.registerOthers(this);
+            try {
+                if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_ITEMS))
+                    plugin.registerItems(RoughlyEnoughItemsCore.getItemRegisterer());
+                if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_CATEGORIES))
+                    plugin.registerPluginCategories(this);
+                if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_RECIPE_DISPLAYS))
+                    plugin.registerRecipeDisplays(this);
+                if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_BOUNDS))
+                    plugin.registerBounds(RoughlyEnoughItemsCore.getDisplayHelper());
+                if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_OTHERS))
+                    plugin.registerOthers(this);
+            } catch (Exception e) {
+                RoughlyEnoughItemsCore.LOGGER.error("[REI] %s plugin failed to load: %s", identifier.toString(), e.getLocalizedMessage());
+            }
         });
         if (getDisplayVisibilityHandlers().size() == 0)
             registerRecipeVisibilityHandler(new DisplayVisibilityHandler() {

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

@@ -327,7 +327,7 @@ public class ContainerScreenOverlay extends AbstractParentElement implements Dra
     @Override
     public void render(int mouseX, int mouseY, float delta) {
         List<ItemStack> currentStacks = ClientHelper.getInventoryItemsTypes();
-        if (getLeft() != lastLeft)
+        if (RoughlyEnoughItemsCore.getDisplayHelper().getBaseBoundsHandler() != null && RoughlyEnoughItemsCore.getDisplayHelper().getBaseBoundsHandler().shouldRecalculateArea(!RoughlyEnoughItemsCore.getConfigManager().getConfig().mirrorItemPanel, rectangle))
             init(true);
         else if (RoughlyEnoughItemsCore.getConfigManager().isCraftableOnlyEnabled() && (!hasSameListContent(new LinkedList<>(ScreenHelper.inventoryStacks), currentStacks) || (currentStacks.size() != ScreenHelper.inventoryStacks.size()))) {
             ScreenHelper.inventoryStacks = ClientHelper.getInventoryItemsTypes();

+ 44 - 40
src/main/java/me/shedaniel/rei/gui/widget/ItemListOverlay.java

@@ -27,7 +27,6 @@ import org.apache.commons.lang3.StringUtils;
 import java.awt.*;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -98,45 +97,49 @@ public class ItemListOverlay extends Widget {
         int startX = (int) rectangle.getCenterX() - width * 9;
         int startY = (int) rectangle.getCenterY() - height * 9;
         this.listArea = new Rectangle((int) startX, (int) startY, width * 18, height * 18);
-        int fitSlotsPerPage = getTotalFitSlotsPerPage(listArea.x, listArea.y, listArea);
+        int fitSlotsPerPage = getTotalFitSlotsPerPage(startX, startY, listArea);
         int j = page * fitSlotsPerPage;
-        for(int i = 0; i < getFullTotalSlotsPerPage(); i++) {
-            j++;
+        for(int yy = 0; yy < height; yy++) {
+            for(int xx = 0; xx < width; xx++) {
+                int x = startX + xx * 18, y = startY + yy * 18;
+                if (!canBeFit(x, y, listArea))
+                    continue;
+                j++;
+                if (j > currentDisplayed.size())
+                    break;
+                widgets.add(new ItemSlotWidget(x, y, Collections.singletonList(currentDisplayed.get(j - 1)), false, true, true) {
+                    @Override
+                    protected void queueTooltip(ItemStack itemStack, float delta) {
+                        ClientPlayerEntity player = minecraft.player;
+                        if (!ClientHelper.isCheating() || player.inventory.getCursorStack().isEmpty())
+                            super.queueTooltip(itemStack, delta);
+                    }
+                    
+                    @Override
+                    public boolean mouseClicked(double mouseX, double mouseY, int button) {
+                        if (isHighlighted(mouseX, mouseY)) {
+                            if (ClientHelper.isCheating()) {
+                                if (getCurrentStack() != null && !getCurrentStack().isEmpty()) {
+                                    ItemStack cheatedStack = getCurrentStack().copy();
+                                    if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.REI_LIKE)
+                                        cheatedStack.setAmount(button != 1 ? 1 : cheatedStack.getMaxAmount());
+                                    else if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.JEI_LIKE)
+                                        cheatedStack.setAmount(button != 0 ? 1 : cheatedStack.getMaxAmount());
+                                    else
+                                        cheatedStack.setAmount(1);
+                                    return ClientHelper.tryCheatingStack(cheatedStack);
+                                }
+                            } else if (button == 0)
+                                return ClientHelper.executeRecipeKeyBind(getCurrentStack().copy());
+                            else if (button == 1)
+                                return ClientHelper.executeUsageKeyBind(getCurrentStack().copy());
+                        }
+                        return false;
+                    }
+                });
+            }
             if (j > currentDisplayed.size())
                 break;
-            int x = startX + (i % width) * 18, y = startY + MathHelper.floor(i / width) * 18;
-            if (!canBeFit(x, y, listArea))
-                continue;
-            widgets.add(new ItemSlotWidget(x, y, Collections.singletonList(currentDisplayed.get(j - 1)), false, true, true) {
-                @Override
-                protected void queueTooltip(ItemStack itemStack, float delta) {
-                    ClientPlayerEntity player = minecraft.player;
-                    if (!ClientHelper.isCheating() || player.inventory.getCursorStack().isEmpty())
-                        super.queueTooltip(itemStack, delta);
-                }
-                
-                @Override
-                public boolean mouseClicked(double mouseX, double mouseY, int button) {
-                    if (isHighlighted(mouseX, mouseY)) {
-                        if (ClientHelper.isCheating()) {
-                            if (getCurrentStack() != null && !getCurrentStack().isEmpty()) {
-                                ItemStack cheatedStack = getCurrentStack().copy();
-                                if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.REI_LIKE)
-                                    cheatedStack.setAmount(button != 1 ? 1 : cheatedStack.getMaxAmount());
-                                else if (RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode == ItemCheatingMode.JEI_LIKE)
-                                    cheatedStack.setAmount(button != 0 ? 1 : cheatedStack.getMaxAmount());
-                                else
-                                    cheatedStack.setAmount(1);
-                                return ClientHelper.tryCheatingStack(cheatedStack);
-                            }
-                        } else if (button == 0)
-                            return ClientHelper.executeRecipeKeyBind(getCurrentStack().copy());
-                        else if (button == 1)
-                            return ClientHelper.executeUsageKeyBind(getCurrentStack().copy());
-                    }
-                    return false;
-                }
-            });
         }
     }
     
@@ -149,9 +152,10 @@ public class ItemListOverlay extends Widget {
     
     public int getTotalFitSlotsPerPage(int startX, int startY, Rectangle listArea) {
         int slots = 0;
-        for(int i = 0; i < getFullTotalSlotsPerPage(); i++)
-            if (canBeFit(startX + (i % width) * 18, startY + MathHelper.floor(i / width) * 18, listArea))
-                slots++;
+        for(int x = 0; x < width; x++)
+            for(int y = 0; y < height; y++)
+                if (canBeFit(startX + x * 18, startY + y * 18, listArea))
+                    slots++;
         return slots;
     }
     

+ 5 - 0
src/main/java/me/shedaniel/rei/listeners/RecipeBookGuiHooks.java

@@ -1,12 +1,17 @@
 package me.shedaniel.rei.listeners;
 
+import net.minecraft.client.gui.recipebook.GroupButtonWidget;
 import net.minecraft.client.gui.widget.RecipeBookGhostSlots;
 import net.minecraft.client.gui.widget.TextFieldWidget;
 
+import java.util.List;
+
 public interface RecipeBookGuiHooks {
     
     RecipeBookGhostSlots rei_getGhostSlots();
     
     TextFieldWidget rei_getSearchField();
     
+    List<GroupButtonWidget> rei_getTabButtons();
+    
 }

+ 13 - 0
src/main/java/me/shedaniel/rei/mixin/MixinRecipeBookGui.java

@@ -1,6 +1,7 @@
 package me.shedaniel.rei.mixin;
 
 import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
+import net.minecraft.client.gui.recipebook.GroupButtonWidget;
 import net.minecraft.client.gui.recipebook.RecipeBookGui;
 import net.minecraft.client.gui.widget.RecipeBookGhostSlots;
 import net.minecraft.client.gui.widget.TextFieldWidget;
@@ -8,6 +9,8 @@ import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Shadow;
 
+import java.util.List;
+
 @Mixin(RecipeBookGui.class)
 public class MixinRecipeBookGui implements RecipeBookGuiHooks {
     
@@ -18,6 +21,10 @@ public class MixinRecipeBookGui implements RecipeBookGuiHooks {
     @Shadow
     private TextFieldWidget searchField;
     
+    @Shadow
+    @Final
+    private List<GroupButtonWidget> tabButtons;
+    
     public RecipeBookGhostSlots rei_getGhostSlots() {
         return ghostSlots;
     }
@@ -27,4 +34,10 @@ public class MixinRecipeBookGui implements RecipeBookGuiHooks {
         return searchField;
     }
     
+    @Override
+    public List<GroupButtonWidget> rei_getTabButtons() {
+        return tabButtons;
+    }
+    
+    
 }

+ 14 - 10
src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java

@@ -5,6 +5,7 @@ import me.shedaniel.rei.RoughlyEnoughItemsCore;
 import me.shedaniel.rei.api.*;
 import me.shedaniel.rei.client.ScreenHelper;
 import me.shedaniel.rei.gui.RecipeViewingScreen;
+import me.shedaniel.rei.listeners.ContainerScreenHooks;
 import me.shedaniel.rei.listeners.RecipeBookGuiHooks;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.ContainerScreen;
@@ -15,6 +16,8 @@ import net.minecraft.client.gui.container.FurnaceScreen;
 import net.minecraft.client.gui.container.SmokerScreen;
 import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
 import net.minecraft.client.gui.ingame.PlayerInventoryScreen;
+import net.minecraft.client.gui.ingame.RecipeBookProvider;
+import net.minecraft.client.gui.recipebook.RecipeBookGui;
 import net.minecraft.enchantment.Enchantment;
 import net.minecraft.enchantment.EnchantmentHelper;
 import net.minecraft.item.ItemStack;
@@ -28,7 +31,6 @@ import net.minecraft.recipe.cooking.SmeltingRecipe;
 import net.minecraft.recipe.cooking.SmokingRecipe;
 import net.minecraft.recipe.crafting.ShapedRecipe;
 import net.minecraft.recipe.crafting.ShapelessRecipe;
-import net.minecraft.util.ActionResult;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
 
@@ -142,6 +144,17 @@ public class DefaultPlugin implements REIPluginEntry {
     
     @Override
     public void registerBounds(DisplayHelper displayHelper) {
+        displayHelper.getBaseBoundsHandler().registerExclusionZones(ContainerScreen.class, isOnRightSide -> {
+            if (isOnRightSide || !MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen() || !(MinecraftClient.getInstance().currentScreen instanceof RecipeBookProvider))
+                return Collections.emptyList();
+            ContainerScreenHooks screenHooks = ScreenHelper.getLastContainerScreenHooks();
+            List l = Lists.newArrayList(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145, screenHooks.rei_getContainerTop(), 4 + 145 + 30, screenHooks.rei_getContainerHeight()));
+            RecipeBookGui recipeBookGui = ((RecipeBookProvider) MinecraftClient.getInstance().currentScreen).getRecipeBookGui();
+            int size = ((RecipeBookGuiHooks) recipeBookGui).rei_getTabButtons().size();
+            if (size > 0)
+                l.add(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145 - 30, screenHooks.rei_getContainerTop(), 30, (size - 1) * 27));
+            return l;
+        });
         displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<ContainerScreen>() {
             @Override
             public Class getBaseSupportedClass() {
@@ -159,15 +172,6 @@ public class DefaultPlugin implements REIPluginEntry {
                 return new Rectangle(startX, 0, MinecraftClient.getInstance().window.getScaledWidth() - startX - 2, MinecraftClient.getInstance().window.getScaledHeight());
             }
             
-            @Override
-            public ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, ContainerScreen screen, Rectangle fullBounds) {
-                if (!isOnRightSide)
-                    if (MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen() && left + 18 > ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4 - 145 - 30)
-                        if (top + 18 >= ScreenHelper.getLastContainerScreenHooks().rei_getContainerTop() && top <= ScreenHelper.getLastContainerScreenHooks().rei_getContainerTop() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerHeight())
-                            return ActionResult.FAIL;
-                return ActionResult.PASS;
-            }
-            
             @Override
             public float getPriority() {
                 return -1.0f;

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

@@ -92,5 +92,5 @@
   "text.rei.config_api_failed": "You arrived here either if Cloth Config API failed or you don't have it installed!\nUpdate / Install the API and report to the bug tracker.",
   "text.rei.back": "Back",
   "_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."
+  "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 - XuyuEre & 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."
 }

+ 5 - 7
src/main/resources/assets/roughlyenoughitems/lang/zh_cn.json

@@ -7,10 +7,10 @@
   "text.rei.config.action": "功能",
   "text.rei.config.cheating": "作弊:",
   "text.rei.cheating": "作弊",
-  "text.rei.cheating_disabled": "§7禁用作弊",
-  "text.rei.cheating_enabled": "§c启用作弊",
-  "text.rei.cheating_limited_enabled": "§b启用作弊(使用命令)",
-  "text.rei.cheating_enabled_no_perms": "§7启用§c作弊§7(无权限)",
+  "text.rei.cheating_disabled": "§7作弊已禁用",
+  "text.rei.cheating_enabled": "§c作弊已启用",
+  "text.rei.cheating_limited_enabled": "§b作弊已启用(使用命令)",
+  "text.rei.cheating_enabled_no_perms": "§7作弊已§c启用§7(无权限)",
   "text.rei.no_permission_cheat": "作弊给予物品需要OP权限",
   "category.rei.crafting": "合成",
   "category.rei.smelting": "冶炼",
@@ -90,7 +90,5 @@
   "text.rei.config.item_cheating_mode.jei_like": "反转",
   "text.rei.config.light_gray_recipe_border": "浅灰色配方边框:",
   "text.rei.config_api_failed": "如果Cloth Config API装载失败了或你没有安装它,你就会到达这个界面!\n升级/安装API或向bug跟踪器报告.",
-  "text.rei.back": "返回",
-  "_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."
+  "text.rei.back": "返回"
 }

+ 11 - 3
src/main/resources/assets/roughlyenoughitems/lang/zh_tw.json

@@ -3,9 +3,15 @@
   "key.roughlyenoughitems.recipe_keybind": "顯示配方",
   "key.roughlyenoughitems.hide_keybind": "隱藏/顯示 REI",
   "key.roughlyenoughitems.usage_keybind": "顯示用途",
-  "text.rei.config.general": "一般",
+  "text.rei.config.general": "常規",
+  "text.rei.config.action": "功能",
   "text.rei.config.cheating": "作弊:",
   "text.rei.cheating": "作弊",
+  "text.rei.cheating_disabled": "§7作弊已禁用",
+  "text.rei.cheating_enabled": "§c作弊已啟用",
+  "text.rei.cheating_limited_enabled": "§b作弊已啟用(使用命令)",
+  "text.rei.cheating_enabled_no_perms": "§7作弊已§c啟用§7(無權限)",
+  "text.rei.no_permission_cheat": "作弊給予物品需要OP權限",
   "category.rei.crafting": "合成",
   "category.rei.smelting": "冶煉",
   "category.rei.smelting.fuel": "§e燃料",
@@ -78,9 +84,11 @@
   "text.rei.config.title": "Roughly Enough Items 配置",
   "text.rei.config.enable_legacy_speedcraft_support": "啟用舊版插件支持: ",
   "text.rei.config.april_fools": "愚人節",
-  "text.rei.config.april_fools.2019": "強制啟用REI 2019 愚人節的玩笑: ",
+  "text.rei.config.april_fools.2019": "強制啟用REI 2019愚人節的玩笑: ",
   "text.rei.config.item_cheating_mode": "物品作弊數量模式:",
   "text.rei.config.item_cheating_mode.rei_like": "標准",
   "text.rei.config.item_cheating_mode.jei_like": "反轉",
-  "text.rei.no_config_api": "Cloth Config API 不存在!\n請安裝它以顯示游戲中的配置界面!"
+  "text.rei.config.light_gray_recipe_border": "淺灰色配方邊框:",
+  "text.rei.config_api_failed": "如果Cloth Config API裝載失敗了或你沒有安裝它,你就會到達這個界面!\n升級/安裝API或向bug跟踪器報告.",
+  "text.rei.back": "返回"
 }