From 8f15fbb24bc043f0d380ae3c6e2d69928a9badcd Mon Sep 17 00:00:00 2001 From: 98ping <67809373+98ping@users.noreply.github.com> Date: Sat, 13 Aug 2022 19:31:50 -0700 Subject: [PATCH] add issued by to rank grant --- .../alchemist/models/grant/types/RankGrant.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/grant/types/RankGrant.kt b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/grant/types/RankGrant.kt index 686e66d26..000abdb61 100644 --- a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/grant/types/RankGrant.kt +++ b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/grant/types/RankGrant.kt @@ -5,6 +5,7 @@ import ltd.matrixstudios.alchemist.models.expirables.Expirable import ltd.matrixstudios.alchemist.models.grant.Grantable import ltd.matrixstudios.alchemist.models.ranks.Rank import ltd.matrixstudios.alchemist.punishments.actor.DefaultActor +import ltd.matrixstudios.alchemist.service.profiles.ProfileGameService import ltd.matrixstudios.alchemist.service.ranks.RankService import java.util.* @@ -30,6 +31,17 @@ class RankGrant( var internalActor: DefaultActor = actor var rank: String = rankId + fun getIssuedByName() : String + { + val profile = ProfileGameService.byId(this.executor) + if (profile == null) + { + return "Console" + } + + return profile.username + } + override fun getGrantable(): Rank? { return RankService.byId(rank) }