package org.cyclops.cyclopscore.block.multi;

import com.google.common.collect.Lists;
import net.minecraft.block.Block;

import java.util.List;

/**
 * Holder class for the allowed blocks in a structure.
 * @author rubensworks
 *
 */
public class AllowedBlock {
	
	private Block block;
	private final List<IBlockCountValidator> countValidators = Lists.newLinkedList();
	
	/**
	 * Make a new instance.
	 * @param block The allowed block.
	 */
	public AllowedBlock(Block block) {
		this.block = block;
	}
	
	/**
	 * Add a count validator
	 * @param countValidator The count validator.
	 * @return This instance.
	 */
	public AllowedBlock addCountValidator(IBlockCountValidator countValidator) {
		this.countValidators.add(countValidator);
		return this;
	}

	/**
	 * @return The count validators
	 */
	public List<IBlockCountValidator> getCountValidators() {
		return countValidators;
	}

	/**
	 * @return the block
	 */
	public Block getBlock() {
		return block;
	}
	
	@Override
	public boolean equals(Object object) {
		return object instanceof AllowedBlock && getBlock().equals(((AllowedBlock)object).getBlock());
	}
	
}
@@ -1113,9 +1113,85 @@
 );%0A%09%7D%0A%09%0A
+%09@Override%0A%09public int hashCode() %7B%0A%09%09return 37 + getBlock().hashCode();%0A%09%7D%0A
 %7D

Implement hashCode on allowedBlock