add toggleable clear inventories on join feature, fix shop

This commit is contained in:
Ivan 2019-11-03 09:10:56 -05:00
parent f05d6a71ae
commit d582398f93
6 changed files with 18 additions and 3 deletions

View File

@ -188,9 +188,15 @@ public class LoginProcess extends FreedomService
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final FPlayer fPlayer = plugin.pl.getPlayer(player); final FPlayer fPlayer = plugin.pl.getPlayer(player);
player.sendTitle(ChatColor.GRAY + "Welcome to " + ChatColor.YELLOW + "TotalFreedom!", ChatColor.GREEN + "Remember to vote and enable verification!", 20, 100, 60); player.sendTitle(ChatColor.GRAY + "Welcome to " + ChatColor.YELLOW + "TotalFreedom!", ChatColor.GREEN + "Celebrating 9 years!", 20, 100, 60);
player.setOp(true); player.setOp(true);
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()) if (!ConfigEntry.SERVER_TABLIST_HEADER.getString().isEmpty())
{ {

View File

@ -203,6 +203,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
mbwr = services.registerService(MasterBuilderWorldRestrictions.class); mbwr = services.registerService(MasterBuilderWorldRestrictions.class);
pl = services.registerService(PlayerList.class); pl = services.registerService(PlayerList.class);
sh = services.registerService(Shop.class);
an = services.registerService(Announcer.class); an = services.registerService(Announcer.class);
cm = services.registerService(ChatManager.class); cm = services.registerService(ChatManager.class);
dc = services.registerService(Discord.class); dc = services.registerService(Discord.class);

View File

@ -39,6 +39,7 @@ public class Command_toggle extends FreedomCommand
msg("- unsafeenchs"); msg("- unsafeenchs");
msg("- bells"); msg("- bells");
msg("- armorstands"); msg("- armorstands");
msg("- clearonjoin");
return false; return false;
} }
@ -171,6 +172,11 @@ public class Command_toggle extends FreedomCommand
toggle("The placement of armor stands is", ConfigEntry.ALLOW_ARMOR_STANDS); toggle("The placement of armor stands is", ConfigEntry.ALLOW_ARMOR_STANDS);
return true; return true;
} }
else if (args[0].equalsIgnoreCase("clearonjoin"))
{
toggle("The clearing of inventories on join is", ConfigEntry.ALLOW_CLEAR_ON_JOIN);
return true;
}
else else
{ {
return false; return false;
@ -189,7 +195,7 @@ public class Command_toggle extends FreedomCommand
{ {
return Arrays.asList( return Arrays.asList(
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk", "waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs", "bells", "armorstands"); "firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs", "bells", "armorstands", "clearonjoin");
} }
return Collections.emptyList(); return Collections.emptyList();

View File

@ -24,6 +24,7 @@ public enum ConfigEntry
ALLOW_UNSAFE_ENCHANTMENTS(Boolean.class, "allow.unsafe_enchantments"), ALLOW_UNSAFE_ENCHANTMENTS(Boolean.class, "allow.unsafe_enchantments"),
ALLOW_BELLS(Boolean.class, "allow.bells"), ALLOW_BELLS(Boolean.class, "allow.bells"),
ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"), ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"),
ALLOW_CLEAR_ON_JOIN(Boolean.class, "allow.clearonjoin"),
// //
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"), BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
// //

View File

@ -38,7 +38,7 @@ public class FUtil
// //
public static final String SAVED_FLAGS_FILENAME = "savedflags.dat"; public static final String SAVED_FLAGS_FILENAME = "savedflags.dat";
// See https://github.com/TotalFreedom/License - None of the listed names may be removed. // See https://github.com/TotalFreedom/License - None of the listed names may be removed.
public static final List<String> DEVELOPERS = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "OxLemonxO", "Wild1145", "Catholic_Mario", "Arcaknight", "homeybee"); public static final List<String> DEVELOPERS = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "OxLemonxO", "Wild1145", "Catholic_Mario", "Arcaknight", "RealIvan");
public static String DATE_STORAGE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z"; public static String DATE_STORAGE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>(); public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>();
public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList( public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList(

View File

@ -117,6 +117,7 @@ allow:
unsafe_enchantments: true unsafe_enchantments: true
bells: true bells: true
armorstands: false armorstands: false
clearonjoin: false
# Blocked commands: # Blocked commands:
# #