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;
|
2013-01-11 21:01:47 +01:00
|
|
|
import com.pahimar.ee3.core.helper.LocalizationHelper;
|
|
|
|
import com.pahimar.ee3.lib.Colours;
|
|
|
|
import com.pahimar.ee3.lib.Commands;
|
|
|
|
import com.pahimar.ee3.lib.Strings;
|
2012-12-21 03:31:59 +01:00
|
|
|
|
|
|
|
public class CommandParticles {
|
|
|
|
|
|
|
|
public static void processCommand(ICommandSender commandSender, String[] args) {
|
|
|
|
|
|
|
|
String subCommand;
|
|
|
|
|
|
|
|
if (args.length > 0) {
|
|
|
|
subCommand = args[0];
|
|
|
|
|
2013-01-11 21:01:47 +01:00
|
|
|
if (subCommand.toLowerCase().equals(Commands.COMMAND_ON)) {
|
2012-12-21 16:44:15 +01:00
|
|
|
processOnCommand(commandSender);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
2013-01-11 21:01:47 +01:00
|
|
|
else if (subCommand.toLowerCase().equals(Commands.COMMAND_OFF)) {
|
2012-12-21 16:44:15 +01:00
|
|
|
processOffCommand(commandSender);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
|
|
|
else {
|
2013-01-11 21:01:47 +01:00
|
|
|
throw new WrongUsageException(Commands.COMMAND_PARTICLES_USAGE, new Object[0]);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2013-01-11 21:01:47 +01:00
|
|
|
throw new WrongUsageException(Commands.COMMAND_PARTICLES_USAGE, new Object[0]);
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|
|
|
|
}
|
2012-12-21 16:44:15 +01:00
|
|
|
|
|
|
|
private static void processOnCommand(ICommandSender commandSender) {
|
|
|
|
|
|
|
|
ConfigurationSettings.ENABLE_PARTICLE_FX = true;
|
2013-01-11 21:01:47 +01:00
|
|
|
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, Strings.TRUE);
|
|
|
|
commandSender.sendChatToPlayer(Colours.TEXT_COLOUR_PREFIX_GRAY + LocalizationHelper.getLocalizedString(Commands.COMMAND_PARTICLES_TURNED_ON));
|
2012-12-21 16:44:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void processOffCommand(ICommandSender commandSender) {
|
|
|
|
|
|
|
|
ConfigurationSettings.ENABLE_PARTICLE_FX = false;
|
2013-01-11 21:01:47 +01:00
|
|
|
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, Strings.FALSE);
|
|
|
|
commandSender.sendChatToPlayer(Colours.TEXT_COLOUR_PREFIX_GRAY + LocalizationHelper.getLocalizedString(Commands.COMMAND_PARTICLES_TURNED_OFF));
|
2012-12-21 16:44:15 +01:00
|
|
|
}
|
2012-12-21 03:31:59 +01:00
|
|
|
}
|