Don't hard code some machines to specific gas types

This commit is contained in:
pupnewfster authored and Dave Smith committed 2019-03-12 11:36:52 -06:00
1 parent f8b162bc31
commit d8b6dfbb78
21 files changed
+181 -282

No files matched your search

@@ -685,6 +685,7 @@ public final class RecipeHandler {
}
public boolean containsRecipe(ItemStack input) {
//TODO: Support other input types
for (Object obj : get().entrySet()) {
if (obj instanceof Map.Entry) {
Map.Entry entry = (Map.Entry) obj;
@@ -713,6 +714,7 @@ public final class RecipeHandler {
}
public boolean containsRecipe(Fluid input) {
//TODO: Support other input types
for (Object obj : get().entrySet()) {
if (obj instanceof Map.Entry) {
Map.Entry entry = (Map.Entry) obj;
@@ -729,14 +731,19 @@ public final class RecipeHandler {
}
public boolean containsRecipe(Gas input) {
//TODO: Support other input types
for (Object obj : get().entrySet()) {
if (obj instanceof Map.Entry) {
Map.Entry entry = (Map.Entry) obj;
Gas toCheck = null;
if (entry.getKey() instanceof GasInput) {
if (((GasInput) entry.getKey()).ingredient.getGas() == input) {
return true;
}
toCheck = ((GasInput) entry.getKey()).ingredient.getGas();
} else if (entry.getKey() instanceof AdvancedMachineInput) {
toCheck = ((AdvancedMachineInput) entry.getKey()).gasType;
}
if (toCheck == input) {
return true;
}
}
}