Adds Something that is missing

Adds Futil.strictcolorize (that filters Banned colors on smite and gtfo)

Adds Actual Server-TFM features
Adds Wipewarps
adds wipecoreprotectdata
adds spectator
adds rainbownick
adds rainbowtag
This commit is contained in:
marcocorriero
2017-11-16 23:32:09 +01:00
parent 489bbf4fc9
commit 2443d3eaca
26 changed files with 510 additions and 167 deletions

View File

@ -1,6 +1,8 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.GameRuleHandler;
import me.totalfreedom.totalfreedommod.GameRuleHandler.GameRule;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
@ -25,6 +27,8 @@ public class Command_toggle extends FreedomCommand
msg("- fluidspread");
msg("- lavadmg");
msg("- firespread");
msg("- frostwalk");
msg("- firework");
msg("- prelog");
msg("- lockdown");
msg("- petprotect");
@ -34,133 +38,103 @@ public class Command_toggle extends FreedomCommand
return false;
}
if (args[0].equals("waterplace"))
{
toggle("Water placement is", ConfigEntry.ALLOW_WATER_PLACE);
if (args[0].equals("waterplace")) {
this.toggle("Water placement is", ConfigEntry.ALLOW_WATER_PLACE);
return true;
}
if (args[0].equals("fireplace"))
{
toggle("Fire placement is", ConfigEntry.ALLOW_FIRE_PLACE);
if (args[0].equals("frostwalk")) {
this.toggle("Frost walker enchantment is ", ConfigEntry.ALLOW_FROSTWALKER);
return true;
}
if (args[0].equals("lavaplace"))
{
toggle("Lava placement is", ConfigEntry.ALLOW_LAVA_PLACE);
if (args[0].equals("fireplace")) {
this.toggle("Fire placement is", ConfigEntry.ALLOW_FIRE_PLACE);
return true;
}
if (args[0].equals("fluidspread"))
if (args[0].equals("lavaplace")) {
this.toggle("Lava placement is", ConfigEntry.ALLOW_LAVA_PLACE);
return true;
}
/*if (args[0].equals("explosivearrows"))
{
toggle("Fluid spread is", ConfigEntry.ALLOW_FLUID_SPREAD);
toggle("Explosive arrows are now", ConfigEntry.MAKE_ARROW_EXPLOSIVE);
return true;
}*/
if (args[0].equals("fluidspread")) {
this.toggle("Fluid spread is", ConfigEntry.ALLOW_FLUID_SPREAD);
return true;
}
if (args[0].equals("lavadmg"))
{
toggle("Lava damage is", ConfigEntry.ALLOW_LAVA_DAMAGE);
if (args[0].equals("lavadmg")) {
this.toggle("Lava damage is", ConfigEntry.ALLOW_LAVA_DAMAGE);
return true;
}
if (args[0].equals("firespread"))
{
toggle("Fire spread is", ConfigEntry.ALLOW_FIRE_SPREAD);
plugin.gr.setGameRule(GameRule.DO_FIRE_TICK, ConfigEntry.ALLOW_FIRE_SPREAD.getBoolean());
if (args[0].equals("firespread")) {
this.toggle("Fire spread is", ConfigEntry.ALLOW_FIRE_SPREAD);
((TotalFreedomMod)this.plugin).gr.setGameRule(GameRuleHandler.GameRule.DO_FIRE_TICK, ConfigEntry.ALLOW_FIRE_SPREAD.getBoolean());
return true;
}
if (args[0].equals("prelog"))
{
toggle("Command prelogging is", ConfigEntry.ENABLE_PREPROCESS_LOG);
if (args[0].equals("prelog")) {
this.toggle("Command prelogging is", ConfigEntry.ENABLE_PREPROCESS_LOG);
return true;
}
if (args[0].equals("lockdown"))
{
boolean active = !plugin.lp.isLockdownEnabled();
plugin.lp.setLockdownEnabled(active);
if (args[0].equals("lockdown")) {
final boolean active = !((TotalFreedomMod)this.plugin).lp.isLockdownEnabled();
((TotalFreedomMod)this.plugin).lp.setLockdownEnabled(active);
FUtil.adminAction(sender.getName(), (active ? "A" : "De-a") + "ctivating server lockdown", true);
return true;
}
if (args[0].equals("petprotect"))
{
toggle("Tamed pet protection is", ConfigEntry.ENABLE_PET_PROTECT);
if (args[0].equals("petprotect")) {
this.toggle("Tamed pet protection is", ConfigEntry.ENABLE_PET_PROTECT);
return true;
}
if (args[0].equals("entitywipe"))
{
toggle("Automatic entity wiping is", ConfigEntry.AUTO_ENTITY_WIPE);
if (args[0].equals("entitywipe")) {
this.toggle("Automatic entity wiping is", ConfigEntry.AUTO_ENTITY_WIPE);
return true;
}
if (args[0].equals("nonuke"))
{
if (args.length >= 2)
{
try
{
if (args[0].equals("firework")) {
this.toggle("Firework explosion is", ConfigEntry.ALLOW_FIREWORK_EXPLOSION);
return true;
}
if (args[0].equals("nonuke")) {
if (args.length >= 2) {
try {
ConfigEntry.NUKE_MONITOR_RANGE.setDouble(Math.max(1.0, Math.min(500.0, Double.parseDouble(args[1]))));
}
catch (NumberFormatException nfex)
{
}
catch (NumberFormatException ex2) {}
}
if (args.length >= 3)
{
try
{
if (args.length >= 3) {
try {
ConfigEntry.NUKE_MONITOR_COUNT_BREAK.setInteger(Math.max(1, Math.min(500, Integer.parseInt(args[2]))));
}
catch (NumberFormatException nfex)
{
}
catch (NumberFormatException ex3) {}
}
toggle("Nuke monitor is", ConfigEntry.NUKE_MONITOR_ENABLED);
if (ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{
msg("Anti-freecam range is set to " + ConfigEntry.NUKE_MONITOR_RANGE.getDouble() + " blocks.");
msg("Block throttle rate is set to " + ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger() + " blocks destroyed per 5 seconds.");
this.toggle("Nuke monitor is", ConfigEntry.NUKE_MONITOR_ENABLED);
if (ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean()) {
this.msg("Anti-freecam range is set to " + ConfigEntry.NUKE_MONITOR_RANGE.getDouble() + " blocks.");
this.msg("Block throttle rate is set to " + ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger() + " blocks destroyed per 5 seconds.");
}
return true;
}
if (args[0].equals("explosives"))
{
if (args.length == 2)
{
try
{
if (args[0].equals("explosives")) {
if (args.length == 2) {
try {
ConfigEntry.EXPLOSIVE_RADIUS.setDouble(Math.max(1.0, Math.min(30.0, Double.parseDouble(args[1]))));
}
catch (NumberFormatException ex)
{
msg(ex.getMessage());
catch (NumberFormatException ex) {
this.msg(ex.getMessage());
return true;
}
}
toggle("Explosions are", ConfigEntry.ALLOW_EXPLOSIONS);
if (ConfigEntry.ALLOW_EXPLOSIONS.getBoolean())
{
msg("Radius set to " + ConfigEntry.EXPLOSIVE_RADIUS.getDouble());
this.toggle("Explosions are", ConfigEntry.ALLOW_EXPLOSIONS);
if (ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) {
this.msg("Radius set to " + ConfigEntry.EXPLOSIVE_RADIUS.getDouble());
}
return true;
}
return false;
}
private void toggle(String name, ConfigEntry entry)
{
msg(name + " now " + (entry.setBoolean(!entry.getBoolean()) ? "enabled." : "disabled."));
private void toggle(final String name, final ConfigEntry entry) {
this.msg(name + " now " + (entry.setBoolean(!entry.getBoolean()) ? "enabled." : "disabled."));
}
}