Codestyle
This commit is contained in:
@@ -5,7 +5,7 @@ package com.willfp.boosters
|
|||||||
import com.willfp.boosters.boosters.ActivatedBooster
|
import com.willfp.boosters.boosters.ActivatedBooster
|
||||||
import com.willfp.boosters.boosters.Booster
|
import com.willfp.boosters.boosters.Booster
|
||||||
import com.willfp.boosters.boosters.Boosters
|
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.Bukkit
|
||||||
import org.bukkit.OfflinePlayer
|
import org.bukkit.OfflinePlayer
|
||||||
import org.bukkit.Sound
|
import org.bukkit.Sound
|
||||||
@@ -27,7 +27,7 @@ val OfflinePlayer.boosters: List<Booster>
|
|||||||
val found = mutableListOf<Booster>()
|
val found = mutableListOf<Booster>()
|
||||||
|
|
||||||
for (booster in Boosters.values()) {
|
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) {
|
for (i in 0 until amount) {
|
||||||
found.add(booster)
|
found.add(booster)
|
||||||
}
|
}
|
||||||
@@ -37,12 +37,11 @@ val OfflinePlayer.boosters: List<Booster>
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun OfflinePlayer.getAmountOfBooster(booster: Booster): Int {
|
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) {
|
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 {
|
fun Player.activateBooster(booster: Booster): Boolean {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class Booster(
|
|||||||
return messages
|
return messages
|
||||||
}
|
}
|
||||||
|
|
||||||
val expiryMessages = config.getStrings("messages.expiry")
|
val expiryMessages: List<String> = config.getStrings("messages.expiry")
|
||||||
|
|
||||||
fun getGuiItem(player: Player): ItemStack {
|
fun getGuiItem(player: Player): ItemStack {
|
||||||
return ItemStackBuilder(Items.lookup(config.getString("gui.item")))
|
return ItemStackBuilder(Items.lookup(config.getString("gui.item")))
|
||||||
|
|||||||
Reference in New Issue
Block a user