mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
tpr on join (#153)
This commit is contained in:
parent
b2305a918b
commit
337a612437
@ -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"));
|
||||
|
@ -40,6 +40,7 @@ public class Command_toggle extends FreedomCommand
|
||||
msg("- bells");
|
||||
msg("- armorstands");
|
||||
msg("- clearonjoin");
|
||||
msg("- tpronjoin");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -177,6 +178,11 @@ public class Command_toggle extends FreedomCommand
|
||||
toggle("The clearing of inventories on join is", ConfigEntry.ALLOW_CLEAR_ON_JOIN);
|
||||
return true;
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("tpronjoin"))
|
||||
{
|
||||
toggle("The random teleporting of players on join is ", ConfigEntry.ALLOW_TPR_ON_JOIN);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@ -195,7 +201,7 @@ public class Command_toggle extends FreedomCommand
|
||||
{
|
||||
return Arrays.asList(
|
||||
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
|
||||
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs", "bells", "armorstands", "clearonjoin");
|
||||
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs", "bells", "armorstands", "clearonjoin", "tpronjoin");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
|
@ -26,6 +26,7 @@ public enum ConfigEntry
|
||||
ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"),
|
||||
ALLOW_MINECARTS (Boolean.class, "allow.minecarts"),
|
||||
ALLOW_CLEAR_ON_JOIN(Boolean.class, "allow.clearonjoin"),
|
||||
ALLOW_TPR_ON_JOIN(Boolean.class, "allow.tpronjoin"),
|
||||
//
|
||||
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
||||
//
|
||||
|
@ -125,6 +125,7 @@ allow:
|
||||
armorstands: false
|
||||
minecarts: false
|
||||
clearonjoin: false
|
||||
tpronjoin: false
|
||||
|
||||
# Blocked commands:
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user