2012-12-21 03:31:59 +01:00
|
|
|
package com.pahimar.ee3.command;
|
|
|
|
|
|
|
|
import net.minecraft.command.ICommandSender;
|
|
|
|
import net.minecraft.command.WrongUsageException;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.configuration.ConfigurationHandler;
|
|
|
|
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
|
|
|
|
|
|
|
public class CommandParticles {
|
|
|
|
|
|
|
|
public static void processCommand(ICommandSender commandSender, String[] args) {
|
|
|
|
|
|
|
|
String subCommand;
|
|
|
|
|
|
|
|
if (args.length > 0) {
|
|
|
|
subCommand = args[0];
|
|
|
|
|
|
|
|
if (subCommand.toLowerCase().equals("on")) {
|
2012-12-21 16:44:15 +01:00
|
|
|
processOnCommand(commandSender);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
|
|
|
else if (subCommand.toLowerCase().equals("off")) {
|
2012-12-21 16:44:15 +01:00
|
|
|
processOffCommand(commandSender);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new WrongUsageException("commands.ee3.particles.usage", new Object[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new WrongUsageException("commands.ee3.particles.usage", new Object[0]);
|
|
|
|
}
|
|
|
|
}
|
2012-12-21 16:44:15 +01:00
|
|
|
|
|
|
|
private static void processOnCommand(ICommandSender commandSender) {
|
|
|
|
|
|
|
|
ConfigurationSettings.ENABLE_PARTICLE_FX = true;
|
|
|
|
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, "true");
|
|
|
|
commandSender.sendChatToPlayer("commands.ee3.particles.turned_on");
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void processOffCommand(ICommandSender commandSender) {
|
|
|
|
|
|
|
|
ConfigurationSettings.ENABLE_PARTICLE_FX = false;
|
|
|
|
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, "false");
|
|
|
|
commandSender.sendChatToPlayer("commands.ee3.particles.turned_off");
|
|
|
|
}
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|