@@ -229,7 +229,7 @@ private static Item getOptionalItem(ResourceLocation id, Item fallback) {
229229 }
230230
231231 protected static boolean mouseIn (double mouseX , double mouseY , int x , int y , int width , int height ) {
232- return mouseX >= x && mouseY >= y && mouseX <= x + width && mouseY <= y + height ;
232+ return mouseX >= x && mouseY >= y && mouseX < x + width && mouseY < y + height ;
233233 }
234234
235235 @ Override
@@ -820,7 +820,7 @@ protected void drawCapacitor(GuiGraphics graphics, int mouseX, int mouseY) {
820820 long amount = this .menu .energyStorage .getAmount ();
821821 GraphicsUtil .drawCapacitor (graphics , x , y , capacity , amount , false );
822822
823- if (mouseIn (mouseX , mouseY , x , y , 16 , this .capacitorHeight )) {
823+ if (mouseIn (mouseX , mouseY , x - 1 , y - 1 , OVERLAY_WIDTH + 2 , this .capacitorHeight + 2 )) {
824824 List <Component > lines = new ArrayList <>();
825825 this .appendEnergyTooltip (lines );
826826 this .setTooltipForNextRenderPass (Lists .transform (lines , Component ::getVisualOrderText ));
@@ -865,7 +865,7 @@ protected void drawTanks(GuiGraphics graphics, int mouseX, int mouseY) {
865865 }
866866 }
867867
868- if (this .hoveredTank == null && mouseIn (mouseX , mouseY , this .leftPos + tank .getX (), this .topPos + tank .getY (), tank .getWidth (), tank .getHeight ())) {
868+ if (this .hoveredTank == null && mouseIn (mouseX , mouseY , this .leftPos + tank .getX () - 1 , this .topPos + tank .getY () - 1 , tank .getWidth () + 2 , tank .getHeight () + 2 )) {
869869 this .hoveredTank = tank ;
870870 RenderSystem .disableDepthTest ();
871871 graphics .fill (tank .getX (), tank .getY (), tank .getX () + tank .getWidth (), tank .getY () + tank .getHeight (), 0x80ffffff );
@@ -876,7 +876,7 @@ protected void drawTanks(GuiGraphics graphics, int mouseX, int mouseY) {
876876 graphics .pose ().popPose ();
877877
878878 for (Tank tank : this .menu .tanks ) {
879- if (mouseIn (mouseX , mouseY , this .leftPos + tank .getX (), this .topPos + tank .getY (), tank .getWidth (), tank .getHeight ())) {
879+ if (mouseIn (mouseX , mouseY , this .leftPos + tank .getX () - 1 , this .topPos + tank .getY () - 1 , tank .getWidth () + 2 , tank .getHeight () + 2 )) {
880880 this .setTooltipForNextRenderPass (Lists .transform (tank .getTooltip (), Component ::getVisualOrderText ));
881881 break ;
882882 }
0 commit comments