Applied-Energistics-2-tiler.../src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java

109 lines
2.6 KiB
Java
Raw Normal View History

2014-11-14 12:02:52 +01:00
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
2014-09-24 02:26:27 +02:00
package appeng.core.features.registries.entries;
import java.util.Optional;
2014-09-24 02:26:27 +02:00
import net.minecraft.item.ItemStack;
2015-12-24 02:07:03 +01:00
import appeng.api.features.IGrinderRecipe;
2014-09-24 02:26:27 +02:00
public class AppEngGrinderRecipe implements IGrinderRecipe
2014-09-24 02:26:27 +02:00
{
private final ItemStack in;
private final ItemStack out;
2014-09-24 02:26:27 +02:00
private final float optionalChance;
private final Optional<ItemStack> optionalOutput;
2014-09-24 02:26:27 +02:00
private final float optionalChance2;
private final Optional<ItemStack> optionalOutput2;
2014-09-24 02:26:27 +02:00
private final int turns;
2014-09-24 02:26:27 +02:00
public AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final int cost )
{
this( input, output, null, null, 0, 0, cost );
2014-09-24 02:26:27 +02:00
}
public AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final ItemStack optional, final float chance, final int cost )
{
this( input, output, optional, null, chance, 0, cost );
2014-09-24 02:26:27 +02:00
}
public AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final ItemStack optional1, final ItemStack optional2, final float chance1, final float chance2, final int cost )
{
this.in = input;
this.out = output;
2014-09-24 02:26:27 +02:00
this.optionalOutput = Optional.ofNullable( optional1 );
this.optionalChance = chance1;
2014-09-24 02:26:27 +02:00
this.optionalOutput2 = Optional.ofNullable( optional2 );
2014-12-29 15:13:47 +01:00
this.optionalChance2 = chance2;
2014-09-24 02:26:27 +02:00
this.turns = cost;
2014-09-24 02:26:27 +02:00
}
@Override
public ItemStack getInput()
{
2014-12-29 15:13:47 +01:00
return this.in;
2014-09-24 02:26:27 +02:00
}
@Override
public ItemStack getOutput()
{
2014-12-29 15:13:47 +01:00
return this.out;
2014-09-24 02:26:27 +02:00
}
@Override
public Optional<ItemStack> getOptionalOutput()
2014-09-24 02:26:27 +02:00
{
return this.optionalOutput;
2014-09-24 02:26:27 +02:00
}
@Override
public Optional<ItemStack> getSecondOptionalOutput()
2014-09-24 02:26:27 +02:00
{
return this.optionalOutput2;
2014-09-24 02:26:27 +02:00
}
@Override
public float getOptionalChance()
{
2014-12-29 15:13:47 +01:00
return this.optionalChance;
2014-09-24 02:26:27 +02:00
}
@Override
public float getSecondOptionalChance()
{
2014-12-29 15:13:47 +01:00
return this.optionalChance2;
2014-09-24 02:26:27 +02:00
}
@Override
public int getRequiredTurns()
{
return this.turns;
}
2014-09-24 02:26:27 +02:00
}