All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmb.content.electric.machines.ProcessorSimpleCatalyzedBlock Maven / Gradle / Ivy

Go to download

Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world. THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<

The newest version!
/**
 * 
 */
package mmb.content.electric.machines;

import mmb.NN;
import mmb.content.electric.ElectricMachineGroup.ElectroMachineType;
import mmb.content.electric.helper.Helper;
import mmb.content.electric.helper.SimpleProcessHelper;
import mmb.content.electric.recipes.SimpleRecipe;
import mmb.content.electric.recipes.SimpleRecipeGroup;
import mmb.engine.inv.storage.SingleItemInventory;

/**
 * Runs a stacked or single, catalyzed recipe. The catalyst selects the recipe from the pool of valid recipes with the same item.
 * @author oskar
 * @param  type of recipes
 */
public class ProcessorSimpleCatalyzedBlock<@NN Trecipe extends SimpleRecipe> extends ProcessorAbstractBlock{
	
	//Constructor
	public ProcessorSimpleCatalyzedBlock(ElectroMachineType type, SimpleRecipeGroup group) {
		super(type);
		this.recipes = group;
		helper = new SimpleProcessHelper<>(group, in, out0, type.powermul, elec, type.volt, catalyst);
	}
	
	//Contents
	@NN public final SingleItemInventory catalyst = new SingleItemInventory();
	@Override
	public @NN SingleItemInventory catalyst() {
		return catalyst;
	}
	
	/** The recipe group used for this machine */
	public final SimpleRecipeGroup recipes;
	@Override
	public SimpleRecipeGroup recipes() {
		return recipes;
	}
	
	@NN private final SimpleProcessHelper helper;
	@Override
	public SimpleProcessHelper helper() {
		return helper;
	}
	
	//Block methods
	@Override
	protected ProcessorAbstractBlock copy0() {
		ProcessorSimpleCatalyzedBlock copy = new ProcessorSimpleCatalyzedBlock(type, recipes);
		copy.helper.set(helper);
		copy.catalyst.setContents(catalyst.getContents());
		return copy;
	}

	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy