mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Add API documentation
And add method to add only compatibility to gases
This commit is contained in:
1 parent
8317fd64af
commit
3bd2aad572
3 files changed
+30
-9
No files matched your search
@@ -4,7 +4,6 @@ import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,17 +12,33 @@ public class GasifyableItems {
|
||||
static HashMap<String, GasStack> gasifyableItems = new HashMap<String, GasStack>();
|
||||
static List<Gas> validGases = new ArrayList<>();
|
||||
|
||||
public static void registerGasifyables(String oredict, Gas gas, Integer quantity) {
|
||||
System.out.println("oredict = " + oredict);
|
||||
System.out.println("gas = " + gas);
|
||||
System.out.println("quantity = " + quantity);
|
||||
/**
|
||||
* Registers a new item to gas conversion at a Chemical Injection Chamber.
|
||||
* @param oredict - oredicted item to add
|
||||
* @param gas gas output from oredict item
|
||||
* @param amount amount to create
|
||||
*/
|
||||
public static void registerGasifyables(String oredict, Gas gas, Integer amount) {
|
||||
GasStack gasifyEntry = new GasStack(gas, amount);
|
||||
|
||||
GasStack gasifyEntry = new GasStack(gas, quantity);
|
||||
|
||||
gasifyableItems.put(oredict, gasifyEntry);
|
||||
if (oredict != null)
|
||||
gasifyableItems.put(oredict, gasifyEntry);
|
||||
validGases.add(gas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new gas to be used at the Chemical Injection Chamber.
|
||||
* @param gas gases that can be used and accepted
|
||||
*/
|
||||
public static void registerGasifyables(Gas gas) {
|
||||
validGases.add(gas);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns gas associated to that item's oredict.
|
||||
* @param itemstack to be converted to gas
|
||||
* @return Gas output
|
||||
*/
|
||||
public static GasStack getGasFromItem(ItemStack itemstack) {
|
||||
|
||||
List<String> oredict = MekanismUtils.getOreDictName(itemstack);
|
||||
@@ -35,6 +50,11 @@ public class GasifyableItems {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* defines which gases the Chemical Injection Chamber can accept.
|
||||
* @param gas type of gas to check validity
|
||||
* @return if block accepts gas
|
||||
*/
|
||||
public static boolean isGasValidGasifyable(Gas gas) {
|
||||
return validGases.contains(gas);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user