use of riskyken.armourersWorkshop.common.skin.ExPropsPlayerSkinData in project Armourers-Workshop by RiskyKen.
the class CommandSetWardrobeOption method processCommand.
@Override
public void processCommand(ICommandSender commandSender, String[] currentCommand) {
if (currentCommand.length != 4) {
throw new WrongUsageException(getCommandUsage(commandSender), (Object) currentCommand);
}
EntityPlayerMP player = getPlayer(commandSender, currentCommand[1]);
if (player == null) {
return;
}
String subOption = currentCommand[2];
boolean value = parseBoolean(commandSender, currentCommand[3]);
int subOptionIndex = -1;
for (int i = 0; i < SUB_OPTIONS.length; i++) {
if (subOption.equals(SUB_OPTIONS[i])) {
subOptionIndex = i;
break;
}
}
if (subOptionIndex == -1) {
throw new WrongUsageException(getCommandUsage(commandSender), (Object) currentCommand);
}
ExPropsPlayerSkinData playerEquipmentData = ExPropsPlayerSkinData.get(player);
if (playerEquipmentData != null) {
EquipmentWardrobeData ewd = playerEquipmentData.getEquipmentWardrobeData();
if (subOptionIndex < 4) {
ewd.armourOverride.set(subOptionIndex, !value);
}
if (subOptionIndex == 4) {
ewd.headOverlay = !value;
}
playerEquipmentData.setSkinInfo(ewd, true);
}
}
Aggregations