Fixes #1850: Fixed support for second optional output of the AE2 Grindstone

This commit is contained in:
thatsIch
2015-09-01 23:58:40 +02:00
parent 468cb4e9df
commit 0d312f91af
4 changed files with 24 additions and 9 deletions
@@ -117,7 +117,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
}
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), this.copy( optional2 ), chance, chance2, cost ) );
}
private void injectRecipe( AppEngGrinderRecipe appEngGrinderRecipe )
@@ -55,9 +55,13 @@ public enum GuiText
inWorldFluix, inWorldPurificationCertus, inWorldPurificationNether,
inWorldPurificationFluix, inWorldSingularity, ChargedQuartz, OfSecondOutput,
inWorldPurificationFluix, inWorldSingularity, ChargedQuartz,
NoSecondOutput, Stores, Next, SelectAmount, Lumen, Empty,
NoSecondOutput,
OfSecondOutput,
MultipleOutputs,
Stores, Next, SelectAmount, Lumen, Empty,
ConfirmCrafting, Stored, Crafting, Scheduled, CraftingStatus, Cancel, ETA, ETAFormat,
@@ -109,6 +109,7 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
public String getGuiTexture()
{
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/guis/grinder.png" );
return loc.toString();
}
@@ -194,13 +195,22 @@ public class NEIGrinderRecipeHandler extends TemplateRecipeHandler
this.result = new PositionedStack( recipe.getOutput(), -30 + 107, 47 );
this.ingredients = new ArrayList<PositionedStack>();
if( recipe.getOptionalOutput() != null )
final ItemStack optionalOutput = recipe.getOptionalOutput();
final int optionalChancePercent = (int) ( recipe.getOptionalChance() * 100 );
if( optionalOutput != null )
{
final int chancePercent = (int) (recipe.getOptionalChance() * 100);
this.hasOptional = true;
this.displayChance = String.format( GuiText.OfSecondOutput.getLocal(), chancePercent );
this.ingredients.add( new PositionedStack( recipe.getOptionalOutput(), -30 + 107 + 18, 47 ) );
this.displayChance = String.format( GuiText.OfSecondOutput.getLocal(), optionalChancePercent );
this.ingredients.add( new PositionedStack( optionalOutput, -30 + 107 + 18, 47 ) );
}
final ItemStack secondOptionalOutput = recipe.getSecondOptionalOutput();
final int secondOptionalChancePercent = (int) ( recipe.getSecondOptionalChance() * 100 );
if( secondOptionalOutput != null )
{
this.hasOptional = true;
this.displayChance = String.format( GuiText.MultipleOutputs.getLocal(), optionalChancePercent, secondOptionalChancePercent );
this.ingredients.add( new PositionedStack( secondOptionalOutput, -30 + 107 + 18 + 18, 47 ) );
}
if( recipe.getInput() != null )
@@ -185,8 +185,9 @@ gui.appliedenergistics2.inWorldPurificationFluix=Drop a Fluix Seed made from Flu
gui.appliedenergistics2.inWorldSingularity=To create drop 1 Singularity and 1 Ender Dust and cause an explosion within range of the items.
gui.appliedenergistics2.ChargedQuartz=Charged Certus Quartz is crafted by inserting an uncharged Certus Quartz Crystal into the Charger, and powering it.
gui.appliedenergistics2.ChargedQuartzFind=Charged Certus Quartz can be found in world semi rarely, it appears similar to normal Certus Quartz, except it sparkles.
gui.appliedenergistics2.OfSecondOutput=%1$d%% Chance for second output.
gui.appliedenergistics2.NoSecondOutput=No Secondary Output
gui.appliedenergistics2.OfSecondOutput=%1$d%% Chance for second output.
gui.appliedenergistics2.MultipleOutputs=%1$d%% second, %2$d%% third output.
gui.appliedenergistics2.SelectAmount=Select Amount
gui.appliedenergistics2.CopyMode=Copy Mode
gui.appliedenergistics2.CopyModeDesc=Controls if the contents of the configuration pane are cleared when you remove the cell.