tpr on join (#153)

This commit is contained in:
Super_
2019-11-18 16:45:18 -05:00
committed by Robinson Gallego
parent b2305a918b
commit 337a612437
4 changed files with 17 additions and 4 deletions

View File

@ -192,19 +192,24 @@ public class LoginProcess extends FreedomService
player.sendTitle(ChatColor.GRAY + "Welcome to " + ChatColor.YELLOW + "TotalFreedom!", ChatColor.GREEN + "Celebrating 9 years!", 20, 100, 60);
player.setOp(true);
if (ConfigEntry.ALLOW_CLEAR_ON_JOIN.getBoolean())
if (ConfigEntry.ALLOW_TPR_ON_JOIN.getBoolean())
{
player.getInventory().clear();
int x = FUtil.random(-10000, 10000);
int z = FUtil.random(-10000, 10000);
int y = player.getWorld().getHighestBlockYAt(x, z);
Location location = new Location(player.getLocation().getWorld(), x, y, z);
player.teleport(location);
player.sendMessage(ChatColor.AQUA + "Your inventory has been cleared automatically.");
player.sendMessage(ChatColor.GOLD + "You have been teleported to a random location automatically.");
return;
}
if (ConfigEntry.ALLOW_CLEAR_ON_JOIN.getBoolean())
{
player.getInventory().clear();
player.sendMessage(ChatColor.AQUA + "Your inventory has been cleared automatically.");
return;
}
if (!ConfigEntry.SERVER_TABLIST_HEADER.getString().isEmpty())
{
player.setPlayerListHeader(FUtil.colorize(ConfigEntry.SERVER_TABLIST_HEADER.getString()).replace("\\n", "\n"));