kotlin setup

This commit is contained in:
Taah
2022-06-17 22:23:22 -07:00
parent 6e6b8a4613
commit babda6779e
9 changed files with 77 additions and 62 deletions

View File

@ -0,0 +1,18 @@
package dev.plex.shop.item
import dev.plex.cache.DataUtils
import dev.plex.player.PlexPlayer
import org.bukkit.inventory.ItemStack
import java.util.concurrent.CompletableFuture
abstract class AbstractItem(val item: ItemStack, private val cost: Double)
{
fun purchase(player: PlexPlayer)
{
player.coins.minus(this.cost);
player.player?.inventory?.addItem(this.item);
CompletableFuture.runAsync {
DataUtils.update(player);
}
}
}