Make fusion reactor recipe shapeless, so it can work either way around
This commit is contained in:
parent
32ea97b29e
commit
c201b3dbcf
1 changed files with 6 additions and 2 deletions
|
@ -180,9 +180,13 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
||||||
* @return boolean True if reactor can execute recipe provided
|
* @return boolean True if reactor can execute recipe provided
|
||||||
*/
|
*/
|
||||||
private boolean validateReactorRecipe(FusionReactorRecipe recipe) {
|
private boolean validateReactorRecipe(FusionReactorRecipe recipe) {
|
||||||
if (ItemUtils.isItemEqual(this.getStackInSlot(topStackSlot), recipe.getTopInput(), true, true, true)) {
|
return validateReactorRecipeInputs(recipe, getStackInSlot(topStackSlot), getStackInSlot(bottomStackSlot)) || validateReactorRecipeInputs(recipe, getStackInSlot(bottomStackSlot), getStackInSlot(topStackSlot));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean validateReactorRecipeInputs(FusionReactorRecipe recipe, ItemStack slot1, ItemStack slot2) {
|
||||||
|
if (ItemUtils.isItemEqual(slot1, recipe.getTopInput(), true, true, true)) {
|
||||||
if (recipe.getBottomInput() != null) {
|
if (recipe.getBottomInput() != null) {
|
||||||
if (!ItemUtils.isItemEqual(this.getStackInSlot(bottomStackSlot), recipe.getBottomInput(), true, true, true)) {
|
if (!ItemUtils.isItemEqual(slot2, recipe.getBottomInput(), true, true, true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue