Skip to content

Commit

Permalink
add issued by to rank grant
Browse files Browse the repository at this point in the history
  • Loading branch information
98ping committed Aug 14, 2022
1 parent 5711d90 commit 8f15fbb
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*

Expand All @@ -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)
}
Expand Down

0 comments on commit 8f15fbb

Please sign in to comment.