mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 20:00:00 +00:00
Default HandlerInfo if it can't be found.
This commit is contained in:
1 parent
4dfc4f86bf
commit
c12775bb06
3 files changed
+14
-2
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ mc_version=1.7.10
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
ccl_version=1.1.3.138
|
||||
ccc_version=1.0.7.+
|
||||
mod_version=2.1.0-GTNH-beta6
|
||||
mod_version=2.1.0-GTNH-beta7
|
||||
@@ -261,7 +261,12 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
} else {
|
||||
handlerID = null;
|
||||
}
|
||||
return GuiRecipeTab.getHandlerInfo(handlerName, handlerID);
|
||||
HandlerInfo info = GuiRecipeTab.getHandlerInfo(handlerName, handlerID);
|
||||
|
||||
if (info == null)
|
||||
return GuiRecipeTab.DEFAULT_HANDLER_INFO;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class GuiRecipeTab extends Widget {
|
||||
public static HandlerInfo DEFAULT_HANDLER_INFO = getDefaultHandlerInfo();
|
||||
public static HashMap<String, HandlerInfo> handlerMap = new HashMap<>();
|
||||
|
||||
private final GuiRecipe guiRecipe;
|
||||
@@ -249,6 +250,12 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static HandlerInfo getDefaultHandlerInfo() {
|
||||
final HandlerInfo info = new HandlerInfo("Unknown", "Unknown", "Unknown", false, "");
|
||||
info.setHandlerDimensions(HandlerInfo.DEFAULT_HEIGHT, HandlerInfo.DEFAULT_WIDTH, HandlerInfo.DEFAULT_MAX_PER_PAGE);
|
||||
return info;
|
||||
}
|
||||
|
||||
private static int intOrDefault(String str, int defaultValue) {
|
||||
if (str == null || str.equals("")) return defaultValue;
|
||||
|
||||
Reference in new issue
Block a user