From 2a6b52c962b47cb0fedc876ce2c1b87eea10fc83 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 15 Jul 2015 00:11:51 +0200 Subject: [PATCH] Full support for lives and keeping inventory in dungeons (0.9) --- src/com/dre/dungeonsxl/commands/CMDLives.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/com/dre/dungeonsxl/commands/CMDLives.java diff --git a/src/com/dre/dungeonsxl/commands/CMDLives.java b/src/com/dre/dungeonsxl/commands/CMDLives.java new file mode 100644 index 00000000..ce56c8c8 --- /dev/null +++ b/src/com/dre/dungeonsxl/commands/CMDLives.java @@ -0,0 +1,29 @@ +package com.dre.dungeonsxl.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.dre.dungeonsxl.P; + +public class CMDLives extends DCommand { + + public CMDLives() { + this.command = "lives"; + this.args = 1; + this.help = p.language.get("Help_Cmd_Lives"); + this.isPlayerCommand = true; + } + + @Override + public void onExecute(String[] args, CommandSender sender) { + Player player = (Player) sender; + String lives = ""; + if (P.lives.containsKey(player)) { + lives = String.valueOf(P.lives.get(player)); + p.msg(player, p.language.get("Cmd_Lives").replaceAll("v1", player.getName()).replaceAll("v2", lives)); + } else { + p.msg(player, p.language.get("Error_NotInDungeon")); + } + } + +}