Java Code Examples for erogenousbeef.bigreactors.api.registry.Reactants#standardSolidReactantAmount()

The following examples show how to use erogenousbeef.bigreactors.api.registry.Reactants#standardSolidReactantAmount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OreDictToReactantMapping.java    From BigReactors with MIT License 4 votes vote down vote up
public OreDictToReactantMapping(String oreDictName, int oreAmount, String reactantName) {
	super(oreDictName, oreAmount, reactantName, Reactants.standardSolidReactantAmount);
}
 
Example 2
Source File: OreDictToReactantMapping.java    From BigReactors with MIT License 4 votes vote down vote up
public OreDictToReactantMapping(String oreDictName, String reactantName) {
	super(oreDictName, 1, reactantName, Reactants.standardSolidReactantAmount);
}
 
Example 3
Source File: MultiblockReactor.java    From BigReactors with MIT License 4 votes vote down vote up
protected void refuel() {
	// For now, we only need to check fuel ports when we have more space than can accomodate 1 ingot
	if(fuelContainer.getRemainingSpace() < Reactants.standardSolidReactantAmount) {
		return;
	}
	
	int amtAdded = 0;
	
	// Loop: Consume input reactants from all ports
	for(TileEntityReactorAccessPort port : attachedAccessPorts)
	{
		if(fuelContainer.getRemainingSpace() <= 0) { break; }

		if(!port.isConnected())	{ continue; }

		// See what type of reactant the port contains; if none, skip it.
		String portReactantType = port.getInputReactantType();
		int portReactantAmount = port.getInputReactantAmount();
		if(portReactantType == null || portReactantAmount <= 0) { continue; }
		
		if(!Reactants.isFuel(portReactantType)) { continue; } // Skip nonfuels

		// HACK; TEMPORARY
		// Alias blutonium to yellorium temporarily, until mixed fuels are implemented
		if(portReactantType.equals(StandardReactants.blutonium)) {
			portReactantType = StandardReactants.yellorium;
		}
		
		// How much fuel can we actually add from this type of reactant?
		int amountToAdd = fuelContainer.addFuel(portReactantType, portReactantAmount, false);
		if(amountToAdd <= 0) { continue; }
		
		int portCanAdd = port.consumeReactantItem(amountToAdd);
		if(portCanAdd <= 0) { continue; }
		
		amtAdded = fuelContainer.addFuel(portReactantType, portReactantAmount, true);
	}
	
	if(amtAdded > 0) {
		markReferenceCoordForUpdate();
		markReferenceCoordDirty();
	}
}