* commit forgotten files

This commit is contained in:
Andy Buchholz 2011-05-10 19:18:35 +02:00
parent 516a98c970
commit a709e9c7b3
3 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package org.mcteam.factions.commands;
import org.bukkit.command.CommandSender;
import org.mcteam.factions.Factions;
public class FCommandLock extends FBaseCommand {
public FCommandLock() {
aliases.add("lock");
optionalParameters.add("on|off");
helpDescription = "lock all write stuff";
}
@Override
public boolean hasPermission(CommandSender sender) {
return Factions.hasPermLock(sender);
}
public void perform() {
if( parameters.size() > 0 ) {
setLock( parseBool( parameters.get(0) ));
} else {
if( isLocked() ) {
me.sendMessage("Factions is locked");
} else {
me.sendMessage("Factions is not locked");
}
}
}
}

View File

@ -0,0 +1,38 @@
package org.mcteam.factions.commands;
import org.bukkit.command.CommandSender;
import org.mcteam.factions.Board;
import org.mcteam.factions.Conf;
import org.mcteam.factions.FPlayer;
import org.mcteam.factions.Faction;
import org.mcteam.factions.Factions;
public class FCommandReload extends FBaseCommand {
public FCommandReload() {
aliases.add("reload");
helpDescription = "reloads the config";
}
@Override
public boolean hasPermission(CommandSender sender) {
return Factions.hasPermReload(sender);
}
public void perform() {
Factions.log("=== RELOAD START ===");
long timeInitStart = System.currentTimeMillis();
Conf.load();
FPlayer.load();
Faction.load();
Board.load();
long timeReload = (System.currentTimeMillis()-timeInitStart);
Factions.log("=== RELOAD DONE (Took "+timeReload+"ms) ===");
me.sendMessage("FACTIONS RELOAD DONE IN " + timeReload + "ms");
}
}

View File

@ -0,0 +1,26 @@
package org.mcteam.factions.commands;
import org.bukkit.command.CommandSender;
import org.mcteam.factions.Factions;
public class FCommandSaveAll extends FBaseCommand {
public FCommandSaveAll() {
aliases.add("saveall");
aliases.add("save");
helpDescription = "save factions to disk";
}
@Override
public boolean hasPermission(CommandSender sender) {
return Factions.hasPermSaveAll(sender);
}
public void perform() {
Factions.saveAll();
me.sendMessage("Factions saved to disk!");
}
}