From c208fab359f6883f94f4dc20d84c8fc3d2b1a200 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 21 Mar 2021 12:17:49 +0100 Subject: [PATCH] Force resourcepack --- .../spectatesystem/listener/JoinListener.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); + } } -- 2.39.5