11package com .circulation .random_complement .client .handler ;
22
3- import com .circulation .random_complement .RandomComplement ;
43import com .circulation .random_complement .client .ItemTooltipAdd ;
54import it .unimi .dsi .fastutil .objects .ObjectArrayList ;
65import it .unimi .dsi .fastutil .objects .Reference2ObjectLinkedOpenHashMap ;
76import net .minecraft .client .Minecraft ;
87import net .minecraft .client .gui .GuiScreen ;
98import net .minecraft .client .resources .I18n ;
10- import net .minecraftforge .client .event .GuiScreenEvent ;
119import net .minecraftforge .event .entity .player .ItemTooltipEvent ;
1210import net .minecraftforge .fml .common .eventhandler .SubscribeEvent ;
1311import net .minecraftforge .fml .relauncher .Side ;
1412import net .minecraftforge .fml .relauncher .SideOnly ;
1513
16- import java .util .Collections ;
1714import java .util .List ;
1815import java .util .Map ;
1916
@@ -57,31 +54,31 @@ public void onItemTooltip(ItemTooltipEvent event) {
5754 }
5855 }
5956 }
60-
61- @ SubscribeEvent
62- public void onClientTooltip (GuiScreenEvent .DrawScreenEvent .Pre event ) {
63- if (RandomComplement .proxy .isMouseHasItem ()) return ;
64- final var gui = Minecraft .getMinecraft ().currentScreen ;
65- if (gui == null ) return ;
66- if (GuiScreen .isAltKeyDown ()) {
67- for (var entry : map .entrySet ()) {
68- if (entry .getKey ().isInstance (gui )) {
69- for (var tooltip : entry .getValue ()) {
70- gui .drawHoveringText (tooltip .get (), GuiMouseHelper .getMouseX (), GuiMouseHelper .getMouseY ());
71- }
72- }
73- }
74- } else {
75- for (var entry : map .entrySet ()) {
76- if (entry .getKey ().isInstance (gui )) {
77- for (var tooltip : entry .getValue ()) {
78- if (tooltip .get ().isEmpty ()) continue ;
79- gui .drawHoveringText (Collections .singletonList (I18n .format ("text.rc.tooltip.press_alt" )), GuiMouseHelper .getMouseX (), GuiMouseHelper .getMouseY ());
80- break ;
81- }
82- }
83- }
84- }
85- }
57+ //
58+ // @SubscribeEvent
59+ // public void onClientTooltip(GuiScreenEvent.DrawScreenEvent.Pre event) {
60+ // if (RandomComplement.proxy.isMouseHasItem()) return;
61+ // final var gui = Minecraft.getMinecraft().currentScreen;
62+ // if (gui == null) return;
63+ // if (GuiScreen.isAltKeyDown()) {
64+ // for (var entry : map.entrySet()) {
65+ // if (entry.getKey().isInstance(gui)) {
66+ // for (var tooltip : entry.getValue()) {
67+ // gui.drawHoveringText(tooltip.get(), GuiMouseHelper.getMouseX(), GuiMouseHelper.getMouseY());
68+ // }
69+ // }
70+ // }
71+ // } else {
72+ // for (var entry : map.entrySet()) {
73+ // if (entry.getKey().isInstance(gui)) {
74+ // for (var tooltip : entry.getValue()) {
75+ // if (tooltip.get().isEmpty()) continue;
76+ // gui.drawHoveringText(Collections.singletonList(I18n.format("text.rc.tooltip.press_alt")), GuiMouseHelper.getMouseX(), GuiMouseHelper.getMouseY());
77+ // break;
78+ // }
79+ // }
80+ // }
81+ // }
82+ // }
8683
8784}
0 commit comments