From 7d78c28af585ecd333adcb0c74b704f3157a8bd0 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 5 Dec 2019 20:45:46 +0100 Subject: [PATCH] untested rework of dependent scoreboard source --- .../core/events/PlayerJoinedEvent.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java index cfb0667..0ef2da6 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java @@ -1,6 +1,7 @@ package de.steamwar.core.events; import de.steamwar.scoreboard.SWScoreboard; +import de.steamwar.scoreboard.ScoreboardCallback; import de.steamwar.sql.SteamwarUser; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -8,6 +9,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import java.util.HashMap; + public class PlayerJoinedEvent implements Listener{ @@ -54,5 +57,24 @@ public class PlayerJoinedEvent implements Listener{ event.setQuitMessage("§c§l« §r" + player.getDisplayName()); SWScoreboard.getPlayerBoards().remove(player); + + + + //TEST + SWScoreboard swScoreboard = new SWScoreboard(new ScoreboardCallback() { + @Override + public HashMap getData() { + HashMap data = new HashMap<>(); + data.put("bla", 2); + data.put("lala", 3); + return data; + } + + @Override + public String getTitle() { + return "ES GEHT!!!!"; + } + }); + SWScoreboard.getPlayerBoards().put(player, swScoreboard); } }