diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-26 23:15:33 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-27 23:09:23 -0400 |
| commit | f8322cd21cde68a72b05efbad3a05b8e67c0bdd0 (patch) | |
| tree | d7e60bc8fedadc8fa7ae725571cad1f398eaf6dc /core/src/player/Player.kt | |
| download | kenshinshideandseek2-f8322cd21cde68a72b05efbad3a05b8e67c0bdd0.tar.gz kenshinshideandseek2-f8322cd21cde68a72b05efbad3a05b8e67c0bdd0.tar.bz2 kenshinshideandseek2-f8322cd21cde68a72b05efbad3a05b8e67c0bdd0.zip | |
initial
Diffstat (limited to 'core/src/player/Player.kt')
| -rw-r--r-- | core/src/player/Player.kt | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/core/src/player/Player.kt b/core/src/player/Player.kt new file mode 100644 index 0000000..799bbff --- /dev/null +++ b/core/src/player/Player.kt @@ -0,0 +1,85 @@ +package cat.freya.khs.player + +import cat.freya.khs.world.Effect +import cat.freya.khs.world.Location +import cat.freya.khs.world.Position +import cat.freya.khs.world.World +import java.util.UUID + +// Player wrapper +interface Player { + // Metadata + val uuid: UUID + val name: String + + // Position + val location: Location + val world: World? + + // Stats + var health: Double + var hunger: UInt + + fun heal() + + // Flight + var allowFlight: Boolean + var flying: Boolean + + // Movement + fun teleport(position: Position) + + fun teleport(location: Location) + + fun sendToServer(server: String) + + // Inventory + val inventory: PlayerInventory + + fun showInventory(inv: Inventory) + + fun closeInventory() + + // Potions + fun clearEffects() + + fun giveEffect(effect: Effect) + + fun setSpeed(amplifier: UInt) + + fun setGlow(target: Player, glow: Boolean) + + fun setHidden(target: Player, hidden: Boolean) + + // Messaging + fun message(message: String) + + fun actionBar(message: String) + + fun title(title: String, subTitle: String) + + fun playSound(sound: String, volume: Double, pitch: Double) + + // Block Hunt + fun isDisguised(): Boolean + + fun disguise(material: String) + + fun revealDisguise() + + enum class GameMode { + CREATIVE, + SURVIVAL, + ADVENTURE, + SPECTATOR, + } + + // Other + fun hasPermission(permission: String): Boolean + + fun setGameMode(gameMode: GameMode) + + fun hideBoards() + + fun taunt() +} |