mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
Fix Altar NEI Handler (#25)
* Update build.gradle * Fix Tooltip handling in NEIAltarRecipeHandler * Cleanup * Improve NEI Altar Handler Using the mouse pos again but it now correctly handles >2 recipes per page and NEI 2.0+
This commit is contained in:
1 parent
23c1efe98b
commit
44002d238e
9 files changed
+307
-227
No files matched your search
@@ -1,17 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* Binding Ritual Handler by Arcaratus
|
||||
@@ -113,24 +110,4 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler
|
||||
{
|
||||
return new ResourceLocation("alchemicalwizardry", "gui/nei/bindingRitual.png").toString();
|
||||
}
|
||||
|
||||
public static Point getMousePosition()
|
||||
{
|
||||
Dimension size = displaySize();
|
||||
Dimension res = displayRes();
|
||||
return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1);
|
||||
}
|
||||
|
||||
public static Dimension displaySize()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
return new Dimension(res.getScaledWidth(), res.getScaledHeight());
|
||||
}
|
||||
|
||||
public static Dimension displayRes()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
return new Dimension(mc.displayWidth, mc.displayHeight);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user