Compare commits

..
Author SHA1 Message Date
github-actions[bot]miozuneGitHub GTNH Actions
5c5af1cf77 spotlessApply (#275)
Co-authored-by: miozune <[email protected]>
Co-authored-by: GitHub GTNH Actions <>
2022-08-20 09:46:28 +02:00
github-actions[bot]miozuneGitHub GTNH Actions
1063d3d752 spotlessApply (#274)
Co-authored-by: miozune <[email protected]>
Co-authored-by: GitHub GTNH Actions <>
2022-08-20 09:44:31 +02:00
miozune 1d0ffbbe1b spotlessApply 2022-08-20 12:34:12 +09:00
miozune 5bb41d9d65 updateBuildScript 2022-08-20 12:29:16 +09:00
miozune 14a387129f updateBuildScript 2022-08-20 12:27:28 +09:00
miozune 9a11551e27 Catch exception on drawSlotItem 2022-08-20 12:26:22 +09:00
3 changed files with 25 additions and 39 deletions

No files matched your search

@@ -729,12 +729,10 @@ public class LayoutManager
? !getSearchExpression().equals("")
: !((SearchField) searchField).getFilter().matches(item))) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glTranslatef(0, 0, 150);
drawRect(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, 0x80000000);
GL11.glTranslatef(0, 0, -150);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
}
@@ -312,8 +312,7 @@ public class PresetsWidget extends Widget {
final int directionState = direction.contains(x + mx, y + my) ? 1 : 2;
final int deleteState = delete.contains(x + mx, y + my) ? 1 : 2;
final String displayName =
NEIClientUtils.cropText(PresetsWidget.fontRenderer, tag.displayName, option.w - 6);
final String displayName = NEIClientUtils.cropText(fontRenderer, tag.displayName, option.w - 6);
final String dirName =
tag.whitelist ? translate("presets.whitelist.label") : translate("presets.blacklist.label");
@@ -3,7 +3,6 @@ package codechicken.nei.recipe;
import codechicken.nei.ItemPanels;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerInputHandler;
@@ -13,12 +12,15 @@ import net.minecraft.item.ItemStack;
public class RecipeItemInputHandler implements IContainerInputHandler {
public static boolean lastKeyTyped(ItemStack stackover) {
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
if (NEIClientConfig.isKeyHashDown("gui.overlay_hide")) {
return hideOverlayRecipe();
}
ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
if (stackover == null) {
return false;
}
@@ -26,11 +28,11 @@ public class RecipeItemInputHandler implements IContainerInputHandler {
stackover = stackover.copy();
if (NEIClientConfig.isKeyHashDown("gui.overlay")) {
return openOverlayRecipe(stackover, false);
return openOverlayRecipe(gui, stackover, false);
}
if (NEIClientConfig.isKeyHashDown("gui.overlay_use")) {
return openOverlayRecipe(stackover, true);
return openOverlayRecipe(gui, stackover, true);
}
if (NEIClientConfig.isKeyHashDown("gui.recipe")) {
@@ -42,40 +44,44 @@ public class RecipeItemInputHandler implements IContainerInputHandler {
}
if (NEIClientConfig.isKeyHashDown("gui.bookmark")) {
return saveRecipeInBookmark(stackover, false, false);
return saveRecipeInBookmark(gui, stackover, false, false);
}
if (NEIClientConfig.isKeyHashDown("gui.bookmark_recipe")) {
return saveRecipeInBookmark(stackover, true, false);
return saveRecipeInBookmark(gui, stackover, true, false);
}
if (NEIClientConfig.isKeyHashDown("gui.bookmark_count")) {
return saveRecipeInBookmark(stackover, false, true);
return saveRecipeInBookmark(gui, stackover, false, true);
}
if (NEIClientConfig.isKeyHashDown("gui.bookmark_recipe_count")) {
return saveRecipeInBookmark(stackover, true, true);
return saveRecipeInBookmark(gui, stackover, true, true);
}
return false;
}
public static boolean mouseClicked(ItemStack stackover, int button) {
@Override
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
if (!(gui instanceof GuiRecipe)
|| ItemPanels.itemPanel.contains(mousex, mousey)
|| ItemPanels.bookmarkPanel.contains(mousex, mousey)) return false;
ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
if (stackover != null) {
stackover = stackover.copy();
if (button == 0) {
return GuiCraftingRecipe.openRecipeGui("item", stackover);
return GuiCraftingRecipe.openRecipeGui("item", stackover.copy());
} else if (button == 1) {
return GuiUsageRecipe.openRecipeGui("item", stackover);
return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
}
}
return false;
}
private static boolean hideOverlayRecipe() {
private boolean hideOverlayRecipe() {
if (LayoutManager.overlayRenderer != null) {
LayoutManager.overlayRenderer = null;
@@ -85,20 +91,19 @@ public class RecipeItemInputHandler implements IContainerInputHandler {
return false;
}
private static boolean openOverlayRecipe(ItemStack stack, boolean shift) {
final GuiContainer gui = NEIClientUtils.getGuiContainer();
private boolean openOverlayRecipe(GuiContainer gui, ItemStack stack, boolean shift) {
if (gui == null || gui instanceof GuiRecipe) {
if (gui instanceof GuiRecipe) {
return false;
}
return GuiCraftingRecipe.openRecipeGui("item", true, shift, stack);
}
private static boolean saveRecipeInBookmark(ItemStack stack, boolean saveIngredients, boolean saveStackSize) {
private boolean saveRecipeInBookmark(
GuiContainer gui, ItemStack stack, boolean saveIngredients, boolean saveStackSize) {
if (stack != null) {
final GuiContainer gui = NEIClientUtils.getGuiContainer();
List<PositionedStack> ingredients = null;
String handlerName = "";
@@ -114,22 +119,6 @@ public class RecipeItemInputHandler implements IContainerInputHandler {
return false;
}
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
return lastKeyTyped(GuiContainerManager.getStackMouseOver(gui));
}
@Override
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
if (!(gui instanceof GuiRecipe)
|| ItemPanels.itemPanel.contains(mousex, mousey)
|| ItemPanels.bookmarkPanel.contains(mousex, mousey)) return false;
ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
return mouseClicked(stackover, button);
}
@Override
public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {}