package openmods.model.variant;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.util.Map;
import net.minecraftforge.common.property.IUnlistedProperty;

public class VariantModelState {

	public static final String DEFAULT_MARKER = "<default>";

	public static final IUnlistedProperty<VariantModelState> PROPERTY = new IUnlistedProperty<VariantModelState>() {

		@Override
		public String valueToString(VariantModelState value) {
			return value.selectors.toString();
		}

		@Override
		public boolean isValid(VariantModelState value) {
			return true;
		}

		@Override
		public Class<VariantModelState> getType() {
			return VariantModelState.class;
		}

		@Override
		public String getName() {
			return "selectors";
		}
	};

	public static final VariantModelState EMPTY = new VariantModelState();

	private VariantModelState(Map<String, String> selectors) {
		this.selectors = ImmutableMap.copyOf(selectors);
	}

	private VariantModelState() {
		this(ImmutableMap.<String, String> of());
	}

	public static VariantModelState create() {
		return EMPTY;
	}

	public static VariantModelState create(Map<String, String> selectors) {
		return new VariantModelState(selectors);
	}

	private final Map<String, String> selectors;

	public VariantModelState withKey(String key, String value) {
		Map<String, String> copy = Maps.newHashMap(selectors);
		copy.put(key, value);
		return new VariantModelState(copy);
	}

	public VariantModelState withKey(String key) {
		return withKey(key, DEFAULT_MARKER);
	}

	Map<String, String> getSelectors() {
		return selectors;
	}
}

@@ -130,24 +130,46 @@
 a.util.Map;%0A
+import java.util.Set;%0A
 import net.m
@@ -1567,16 +1567,231 @@
 R);%0A%09%7D%0A%0A
+%09public VariantModelState withKeys(Set%3CString%3E keys) %7B%0A%09%09Map%3CString, String%3E copy = Maps.newHashMap(selectors);%0A%09%09for (String key : keys)%0A%09%09%09copy.put(key, DEFAULT_MARKER);%0A%0A%09%09return new VariantModelState(copy);%0A%09%7D%0A%0A
 %09Map%3CStr

Add new constructor to VariantModelState