Codestyle

This commit is contained in:
Auxilor
2022-02-11 09:26:02 +00:00
parent 91e5140c6f
commit 1ae47f0fd6
2 changed files with 5 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ package com.willfp.boosters
import com.willfp.boosters.boosters.ActivatedBooster
import com.willfp.boosters.boosters.Booster
import com.willfp.boosters.boosters.Boosters
import com.willfp.eco.core.data.PlayerProfile
import com.willfp.eco.core.data.profile
import org.bukkit.Bukkit
import org.bukkit.OfflinePlayer
import org.bukkit.Sound
@@ -27,7 +27,7 @@ val OfflinePlayer.boosters: List<Booster>
val found = mutableListOf<Booster>()
for (booster in Boosters.values()) {
val amount = PlayerProfile.load(this).read(booster.dataKey)
val amount = this.profile.read(booster.dataKey)
for (i in 0 until amount) {
found.add(booster)
}
@@ -37,12 +37,11 @@ val OfflinePlayer.boosters: List<Booster>
}
fun OfflinePlayer.getAmountOfBooster(booster: Booster): Int {
return PlayerProfile.load(this).read(booster.dataKey)
return this.profile.read(booster.dataKey)
}
fun OfflinePlayer.setAmountOfBooster(booster: Booster, amount: Int) {
PlayerProfile.load(this).write(booster.dataKey, amount)
this.profile.write(booster.dataKey, amount)
}
fun Player.activateBooster(booster: Booster): Boolean {

View File

@@ -45,7 +45,7 @@ class Booster(
return messages
}
val expiryMessages = config.getStrings("messages.expiry")
val expiryMessages: List<String> = config.getStrings("messages.expiry")
fun getGuiItem(player: Player): ItemStack {
return ItemStackBuilder(Items.lookup(config.getString("gui.item")))