package io.github.panpog1.potions;

public class If extends Compound {

	private Compound[] conditions;
	private Compound body;

	public If(Compound[] conditions, Compound body) {
		this.conditions = conditions;
		this.body = body;
	}

	@Override
	public String toStringSimple() {
		String s = "";
		for (Compound condition : conditions) {
			s += condition.toStringNoNums() + ",";
		}
		return String.format("If(%s%s)", s, body.toStringNoNums());
	}

	@Override
	public boolean react(Cauldron cauldron) {
		for (Compound condition : conditions)
			if (!cauldron.idgs.contains(condition))
				return false;
		cauldron.idgs.remove(this);
		cauldron.idgs.add(body);
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((body == null) ? 0 : body.hashCode());
		result = prime * result + ((conditions == null) ? 0 : conditions.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		If other = (If) obj;
		if (body == null) {
			if (other.body != null)
				return false;
		} else if (!body.equals(other.body))
			return false;
		if (conditions == null) {
			if (other.conditions != null)
				return false;
		} else if (!conditions.equals(other.conditions))
			return false;
		return true;
	}
}

@@ -29,16 +29,42 @@
 tions;%0A%0A
+import java.util.Arrays;%0A%0A
 public c
@@ -895,57 +895,34 @@
 t + 
-((conditions == null) ? 0 : conditions.hashCode()
+Arrays.hashCode(conditions
 );%0A%09
@@ -1276,95 +1276,23 @@
 if (
-conditions == null) %7B%0A%09%09%09if (other.conditions != null)%0A%09%09%09%09return false;%0A%09%09%7D else if (!
+!Arrays.equals(
 cond
@@ -1297,24 +1297,18 @@
 nditions
-.equals(
+, 
 other.co

Fix If.hashCode() and If.equals(Object)