Merge pull request 'forceResourcepack' (#14) from forceResourcepack into master
Reviewed-on: #14 Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Commit
c0045d7064
@ -31,6 +31,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
|
||||||
|
|
||||||
public class JoinListener extends BasicListener {
|
public class JoinListener extends BasicListener {
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ public class JoinListener extends BasicListener {
|
|||||||
e.setJoinMessage(null);
|
e.setJoinMessage(null);
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
|
|
||||||
|
player.setResourcePack("https://steamwar.de/antixray.zip");
|
||||||
player.teleport(Config.SpecSpawn);
|
player.teleport(Config.SpecSpawn);
|
||||||
REntity.playerJoins(player);
|
REntity.playerJoins(player);
|
||||||
PlayerSetup.playerJoins(player);
|
PlayerSetup.playerJoins(player);
|
||||||
@ -65,4 +67,14 @@ public class JoinListener extends BasicListener {
|
|||||||
PlayerSetup.playerLeaves(e.getPlayer());
|
PlayerSetup.playerLeaves(e.getPlayer());
|
||||||
e.setQuitMessage(null);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren