2
2
3
3
import codes .biscuit .skyblockaddons .SkyblockAddons ;
4
4
import codes .biscuit .skyblockaddons .core .EssenceType ;
5
+ import codes .biscuit .skyblockaddons .core .chroma .ManualChromaManager ;
5
6
import codes .biscuit .skyblockaddons .core .feature .Feature ;
6
7
import codes .biscuit .skyblockaddons .core .feature .FeatureSetting ;
7
8
import codes .biscuit .skyblockaddons .events .RenderEntityOutlineEvent ;
@@ -106,8 +107,8 @@ public class DungeonManager {
106
107
if (e instanceof EntityOtherPlayerMP ) {
107
108
String profileName = ((EntityOtherPlayerMP ) e ).getGameProfile ().getName ();
108
109
DungeonPlayer teammate = SkyblockAddons .getInstance ().getDungeonManager ().getDungeonPlayerByName (profileName );
109
- if (teammate != null ) {
110
- return teammate .getDungeonClass ().getColor (). getColor () ;
110
+ if (teammate != null && teammate . getDungeonClass () != null ) {
111
+ return teammate .getDungeonClass ().getColor ();
111
112
}
112
113
// NPCs don't have a color on their team. Don't show them on outlines.
113
114
return null ;
@@ -385,17 +386,18 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
385
386
return ;
386
387
}
387
388
388
- if (main .getUtils ().isOnSkyblock () && main .getUtils ().isInDungeon ()
389
- && (Feature .SHOW_CRITICAL_DUNGEONS_TEAMMATES .isEnabled () || Feature .SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY .isEnabled ())
390
- ) {
389
+ boolean nameOverlayEnabled = Feature .SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY .isEnabled ();
390
+ boolean criticalOverlayEnabled = Feature .SHOW_CRITICAL_DUNGEONS_TEAMMATES .isEnabled ();
391
+
392
+ if (main .getUtils ().isOnSkyblock () && main .getUtils ().isInDungeon () && (criticalOverlayEnabled || nameOverlayEnabled )) {
391
393
final Entity renderViewEntity = MC .getRenderViewEntity ();
392
394
String profileName = player .getName ();
393
395
DungeonPlayer dungeonPlayer = main .getDungeonManager ().getTeammates ().getOrDefault (profileName , null );
394
396
395
397
if (renderViewEntity != player && dungeonPlayer != null ) {
396
398
double newY = e .y + player .height ;
397
399
398
- if (Feature . SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY . isEnabled () ) {
400
+ if (nameOverlayEnabled ) {
399
401
newY += 0.35F ;
400
402
}
401
403
@@ -422,7 +424,7 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
422
424
GlStateManager .enableTexture2D ();
423
425
GlStateManager .color (1 , 1 , 1 , 1 );
424
426
425
- if (Feature . SHOW_CRITICAL_DUNGEONS_TEAMMATES . isEnabled () && !dungeonPlayer .isGhost ()
427
+ if (criticalOverlayEnabled && !dungeonPlayer .isGhost ()
426
428
&& (dungeonPlayer .isCritical () || dungeonPlayer .isLow ())) {
427
429
MC .getTextureManager ().bindTexture (CRITICAL );
428
430
DrawUtils .drawModalRectWithCustomSizedTexture (-CRITICAL_ICON_SIZE / 2F , -CRITICAL_ICON_SIZE , 0 , 0 , CRITICAL_ICON_SIZE , CRITICAL_ICON_SIZE , CRITICAL_ICON_SIZE , CRITICAL_ICON_SIZE );
@@ -448,16 +450,22 @@ public void onRenderLivingName(RenderLivingEvent.Specials.Pre<EntityLivingBase>
448
450
e .setCanceled (true );
449
451
}
450
452
451
- if (!dungeonPlayer .isGhost () && Feature .SHOW_DUNGEON_TEAMMATE_NAME_OVERLAY .isEnabled ()) {
452
- String nameOverlay =
453
- ColorCode .YELLOW + "[" + dungeonPlayer .getDungeonClass ().getFirstLetter () + "] "
454
- + dungeonPlayer .getDungeonClass ().getColor () + profileName ;
455
- MC .fontRendererObj .drawString (
456
- nameOverlay ,
457
- -MC .fontRendererObj .getStringWidth (nameOverlay ) / 2F ,
458
- CRITICAL_ICON_SIZE / 2F + 2 ,
459
- -1 ,
460
- true
453
+ if (!dungeonPlayer .isGhost () && dungeonPlayer .getDungeonClass () != null && nameOverlayEnabled ) {
454
+ String dungeonClass = ColorCode .YELLOW + "[" + dungeonPlayer .getDungeonClass ().getFirstLetter () + "] " ;
455
+ float nameX = MC .fontRendererObj .getStringWidth (dungeonClass .concat (profileName )) / 2F ;
456
+ float nameY = CRITICAL_ICON_SIZE / 2F + 2 ;
457
+
458
+ DrawUtils .drawText (dungeonClass , -nameX , nameY , -1 );
459
+
460
+ int classColor = dungeonPlayer .getDungeonClass ().getColor ();
461
+ if (classColor == ColorCode .CHROMA .getColor ()) {
462
+ classColor = ManualChromaManager .getChromaColor (0 , 0 , 255 );
463
+ }
464
+ DrawUtils .drawText (
465
+ profileName ,
466
+ -nameX + MC .fontRendererObj .getStringWidth (dungeonClass ),
467
+ nameY ,
468
+ classColor
461
469
);
462
470
463
471
String health = dungeonPlayer .getHealth () + (ColorCode .RED + "❤" );
0 commit comments