From 9b487e929c43090256977e3b431c4964f3e784f1 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Fri, 24 Dec 2021 17:16:01 +0100 Subject: [PATCH] Fixes --- .../bungeecore/commands/PlaytimeCommand.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java b/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java index 003f3dcf..47b96a89 100644 --- a/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java +++ b/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java @@ -1,3 +1,22 @@ +/* + This file is a part of the SteamWar software. + + Copyright (C) 2020 SteamWar.de-Serverteam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; @@ -13,7 +32,10 @@ public class PlaytimeCommand extends BasicCommand{ super("playtime", null); } - @Override public void execute(CommandSender sender, String[] strings) { + @Override + public void execute(CommandSender sender, String[] strings) { + if(!(sender instanceof ProxiedPlayer)) + return; ProxiedPlayer player = (ProxiedPlayer) sender; SteamwarUser user = SteamwarUser.get(player); Message.send("WHOIS_HOURS_PLAYED", player, new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600));