aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java
blob: febe70fc4fdb0be5d9c994d7f27ab7735a9bf7d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.anthonyhilyard.iceberg.events;

import java.util.List;

import com.mojang.blaze3d.vertex.PoseStack;

import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.client.event.RenderTooltipEvent;

public class RenderTooltipExtEvent
{
	public static class Pre extends RenderTooltipEvent.Pre
	{
		private final boolean comparisonTooltip;
		private final int index;

		public Pre(ItemStack stack, PoseStack PoseStack, int x, int y, int screenWidth, int screenHeight, Font font, List<ClientTooltipComponent> components, boolean comparison, int index)
		{
			super(stack, PoseStack, x, y, screenWidth, screenHeight, font, components);
			this.comparisonTooltip = comparison;
			this.index = index;
		}

		public Pre(ItemStack stack, PoseStack PoseStack, int x, int y, int screenWidth, int screenHeight, Font font, List<ClientTooltipComponent> components, boolean comparison)
		{
			this(stack, PoseStack, x, y, screenWidth, screenHeight, font, components, comparison, 0);
		}
		public boolean isComparison() { return comparisonTooltip; }
		public int getIndex() { return index; }
	}

	public static class Post extends RenderTooltipEvent
	{
		private final boolean comparisonTooltip;
		private final int index;
		private final int width;
		private final int height;

		public Post(ItemStack stack, PoseStack PoseStack, int x, int y, Font font, int width, int height, List<ClientTooltipComponent> components, boolean comparison, int index)
		{
			super(stack, PoseStack, x, y, font, components);
			this.width = width;
			this.height = height;
			this.comparisonTooltip = comparison;
			this.index = index;
		}

		public Post(ItemStack stack, PoseStack PoseStack, int x, int y, Font font, int width, int height, List<ClientTooltipComponent> components, boolean comparison)
		{
			this(stack, PoseStack, x, y, font, width, height, components, comparison, 0);
		}
		public boolean isComparison() { return comparisonTooltip; }
		public int getIndex() { return index; }
		public int getWidth() { return width; }
		public int getHeight() { return height; }
	}

	public static class Color extends RenderTooltipEvent.Color
	{
		private final boolean comparisonTooltip;
		private final int index;

		public Color(ItemStack stack, PoseStack PoseStack, int x, int y, Font font, int background, int borderStart, int borderEnd, List<ClientTooltipComponent> components, boolean comparison, int index)
		{
			super(stack, PoseStack, x, y, font, background, borderStart, borderEnd, components);
			this.comparisonTooltip = comparison;
			this.index = index;
		}
		public Color(ItemStack stack, PoseStack PoseStack, int x, int y, Font font, int background, int borderStart, int borderEnd, List<ClientTooltipComponent> components, boolean comparison)
		{
			this(stack, PoseStack, x, y, font, background, borderStart, borderEnd, components, comparison, 0);
		}
		public Color(ItemStack stack, PoseStack PoseStack, int x, int y, Font font, int backgroundStart, int backgroundEnd, int borderStart, int borderEnd, List<ClientTooltipComponent> components, boolean comparison, int index)
		{
			this(stack, PoseStack, x, y, font, backgroundStart, borderStart, borderEnd, components, comparison, index);
			setBackgroundStart(backgroundStart);
			setBackgroundEnd(backgroundEnd);
		}
		public boolean isComparison() { return comparisonTooltip; }
		public int getIndex() { return index; }
	}
}