diff --git a/src/de/steamwar/spectatesystem/listener/JoinListener.java b/src/de/steamwar/spectatesystem/listener/JoinListener.java index 64715d6..bd76dc2 100644 --- a/src/de/steamwar/spectatesystem/listener/JoinListener.java +++ b/src/de/steamwar/spectatesystem/listener/JoinListener.java @@ -31,6 +31,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerResourcePackStatusEvent; public class JoinListener extends BasicListener { @@ -51,6 +52,7 @@ public class JoinListener extends BasicListener { e.setJoinMessage(null); Player player = e.getPlayer(); + player.setResourcePack("https://steamwar.de/antixray.zip"); player.teleport(Config.SpecSpawn); REntity.playerJoins(player); PlayerSetup.playerJoins(player); @@ -65,4 +67,14 @@ public class JoinListener extends BasicListener { PlayerSetup.playerLeaves(e.getPlayer()); e.setQuitMessage(null); } + + @EventHandler + public void onResourcepack(PlayerResourcePackStatusEvent e){ + if(e.getStatus() == PlayerResourcePackStatusEvent.Status.ACCEPTED || e.getStatus() == PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED) + return; + + Player player = e.getPlayer(); + player.sendMessage("§eSteam§8War» §cAuf Eventserver kann nur mit dem SteamWar-Resourcepack beigetreten werden"); + player.kickPlayer(null); + } }