diff --git a/gradle.properties b/gradle.properties index 886aa95a8..fa4679f87 100644 --- a/gradle.properties +++ b/gradle.properties @@ -80,7 +80,7 @@ apiPackage = api # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ # There can be multiple files in a space-separated list. # Example value: mymodid_at.cfg nei_at.cfg -accessTransformersFile = +accessTransformersFile = forestry_at.cfg # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false @@ -200,4 +200,3 @@ curseForgeRelations = # Whether IDEA should run spotless checks when pressing the Build button. # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true - diff --git a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java index 7b52c325c..8e0f17259 100644 --- a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java +++ b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java @@ -112,18 +112,12 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements public List handleTooltip(GuiRecipe guiRecipe, List currenttip, int recipe) { super.handleTooltip(guiRecipe, currenttip, recipe); CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); + if (GuiContainerManager.shouldShowTooltip(guiRecipe)) { Point mouse = GuiDraw.getMousePosition(); - int recipeIndex = guiRecipe.getRecipeIndices().indexOf(recipe); - - if (recipeIndex >= 0) { - Point offset = guiRecipe.getRecipePosition(recipeIndex); - Point relMouse = new Point( - mouse.x - (guiRecipe.width - 176) / 2 - offset.x, - mouse.y - (guiRecipe.height - 166) / 2 - offset.y); - - currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse); - } + Point offset = guiRecipe.getRecipePosition(recipe); + Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y); + currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse); } return currenttip; @@ -135,18 +129,10 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements super.handleItemTooltip(guiRecipe, itemStack, currenttip, recipe); CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); Point mouse = GuiDraw.getMousePosition(); - int recipeIndex = guiRecipe.getRecipeIndices().indexOf(recipe); + Point offset = guiRecipe.getRecipePosition(recipe); + Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y); - if (recipeIndex >= 0) { - Point offset = guiRecipe.getRecipePosition(recipeIndex); - Point relMouse = new Point( - mouse.x - (guiRecipe.width - 176) / 2 - offset.x, - mouse.y - (guiRecipe.height - 166) / 2 - offset.y); - - currenttip = this.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); - } - - return currenttip; + return this.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); } public List provideTooltip(GuiRecipe guiRecipe, List currenttip, CachedBaseRecipe crecipe, @@ -210,11 +196,9 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) { CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); - Point mousepos = GuiDraw.getMousePosition(); + Point mouse = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); - Point relMouse = new Point( - mousepos.x - (guiRecipe.width - 176) / 2 - offset.x, - mousepos.y - (guiRecipe.height - 166) / 2 - offset.y); + Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y); if (crecipe.getFluidTanks() != null) { for (PositionedFluidTank tank : crecipe.getFluidTanks()) { diff --git a/src/main/resources/META-INF/forestry_at.cfg b/src/main/resources/META-INF/forestry_at.cfg new file mode 100644 index 000000000..e4fbccda3 --- /dev/null +++ b/src/main/resources/META-INF/forestry_at.cfg @@ -0,0 +1,5 @@ +# Forestry Access Transformer configuration file +public net.minecraft.client.gui.inventory.GuiContainer field_146999_f #xSize +public net.minecraft.client.gui.inventory.GuiContainer field_147000_g #ySize +public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft +public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiTop \ No newline at end of file