@@ -1302,11 +1302,8 @@ public void renderTooltip(Component message, double mouseX, double mouseY) {
1302
1302
}
1303
1303
1304
1304
public void renderTooltip (Component message , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom ) {
1305
- this .renderTooltip (List .of (message .getVisualOrderText ()), mouseX , mouseY , backgroundTop , backgroundBottom , borderTop , borderBottom );
1306
- }
1307
-
1308
- public void componentTooltip (List <Component > tooltips , double mouseX , double mouseY ) {
1309
- componentTooltip (tooltips , mouseX , mouseY , 0xf0100010 , 0xf0100010 , 0x505000ff , 0x5028007f );
1305
+ List <ClientTooltipComponent > list = ForgeHooksClient .gatherTooltipComponents (tooltipStack , List .of (message ), Optional .empty (), (int ) mouseX , guiWidth (), guiHeight (), font ());
1306
+ this .renderTooltipInternal (list , mouseX , mouseY , backgroundTop , backgroundBottom , borderTop , borderBottom , DefaultTooltipPositioner .INSTANCE );
1310
1307
}
1311
1308
1312
1309
public void componentTooltip (List <Component > tooltips , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom ) {
@@ -1318,21 +1315,34 @@ public void componentTooltip(List<? extends FormattedText> tooltips, double mous
1318
1315
componentTooltip (tooltips , mouseX , mouseY , 0xf0100010 , 0xf0100010 , 0x505000ff , 0x5028007f , stack );
1319
1316
}
1320
1317
1321
- public void componentTooltip (List <? extends net .minecraft .network .chat .FormattedText > tooltips , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom , ItemStack stack ) {
1318
+ public void componentTooltip (List <? extends FormattedText > tooltips , double mouseX , double mouseY ) {
1319
+ componentTooltip (tooltips , mouseX , mouseY , 0xf0100010 , 0xf0100010 , 0x505000ff , 0x5028007f , ItemStack .EMPTY );
1320
+ }
1321
+
1322
+ public void componentTooltip (List <? extends FormattedText > tooltips , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom , ItemStack stack ) {
1322
1323
this .tooltipStack = stack ;
1323
1324
List <ClientTooltipComponent > list = ForgeHooksClient .gatherTooltipComponents (tooltipStack , tooltips , Optional .empty (), (int ) mouseX , guiWidth (), guiHeight (), font ());
1324
1325
this .renderTooltipInternal (list , mouseX , mouseY , backgroundTop , backgroundBottom , borderTop , borderBottom , DefaultTooltipPositioner .INSTANCE );
1325
1326
this .tooltipStack = ItemStack .EMPTY ;
1326
1327
}
1327
1328
1329
+ /**
1330
+ * Warning: This tooltip method with not automatically wrap tooltip lines
1331
+ */
1328
1332
public void renderTooltip (List <? extends FormattedCharSequence > tooltips , double mouseX , double mouseY ) {
1329
1333
renderTooltip (tooltips , mouseX , mouseY , 0xf0100010 , 0xf0100010 , 0x505000ff , 0x5028007f );
1330
1334
}
1331
1335
1336
+ /**
1337
+ * Warning: This tooltip method with not automatically wrap tooltip lines
1338
+ */
1332
1339
public void renderTooltip (List <? extends FormattedCharSequence > tooltips , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom ) {
1333
1340
this .renderTooltipInternal (tooltips .stream ().map (ClientTooltipComponent ::create ).collect (Collectors .toList ()), mouseX , mouseY , backgroundTop , backgroundBottom , borderTop , borderBottom , DefaultTooltipPositioner .INSTANCE );
1334
1341
}
1335
1342
1343
+ /**
1344
+ * Warning: This tooltip method with not automatically wrap tooltip lines
1345
+ */
1336
1346
public void renderTooltip (List <FormattedCharSequence > tooltips , ClientTooltipPositioner positioner , double mouseX , double mouseY , int backgroundTop , int backgroundBottom , int borderTop , int borderBottom ) {
1337
1347
this .renderTooltipInternal (tooltips .stream ().map (ClientTooltipComponent ::create ).collect (Collectors .toList ()), mouseX , mouseY , backgroundTop , backgroundBottom , borderTop , borderBottom , positioner );
1338
1348
}
0 commit comments