Skip to content

Commit

Permalink
Core material is now a materialmatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
chatasma committed Jul 4, 2024
1 parent 77d9fae commit d5f869d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ class MatchTracker : Listener {
return match.getModule(GoalMatchModule::class.java)
?.getGoals(Core::class.java)
?.values()
?.map { CorePartial(it.id, it.name, it.owner.nameLegacy, it.material.itemType) }?.distinctBy { it.id }
?.mapNotNull {
val definition = it.definition
val materialMatcher = definition.material
if (materialMatcher.materials.isEmpty()) return@mapNotNull null
CorePartial(it.id, it.name, it.owner.nameLegacy, materialMatcher.materials.iterator().next())
}?.distinctBy { it.id }
?: listOf()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import tc.oc.pgm.teams.Team
import tc.oc.pgm.util.named.NameDecorationProvider
import tc.oc.pgm.util.named.NameStyle
import tc.oc.pgm.util.player.PlayerComponent
import tc.oc.pgm.util.player.PlayerRenderer
import tc.oc.pgm.util.tablist.PlayerTabEntry
import tc.oc.pgm.util.tablist.TabView

Expand Down Expand Up @@ -54,7 +55,7 @@ class LeveledPlayerTabEntry(player: Player) : PlayerTabEntry(player) {
if (!isOffline && style.contains(NameStyle.Flag.DEATH) && isDead()) {
name.color(NamedTextColor.DARK_GRAY)
} else if (style.contains(NameStyle.Flag.COLOR)) {
name.color(if (isOffline) PlayerComponent.OFFLINE_COLOR else provider.getColor(uuid))
name.color(if (isOffline) PlayerRenderer.OFFLINE_COLOR else provider.getColor(uuid))
}
if (!isOffline && style.contains(NameStyle.Flag.SELF) && player === viewer) {
name.decoration(TextDecoration.BOLD, true)
Expand Down

0 comments on commit d5f869d

Please sign in to comment.