Skip to content

Commit

Permalink
Temporary recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
raphydaphy committed Sep 5, 2018
1 parent 8ce507e commit e1fbaff
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/main/java/com/raphydaphy/rocksolid/gui/GuiAssemblyStation.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,11 @@ public final void render(IGameInstance game, IAssetManager assetManager, IRender

int drawY = 14;

assetManager.getFont().drawAutoScaledString((float) (this.x + 116 + offset), (float) (this.y + drawY), RockBottomAPI.getGame().getAssetManager().localize(CAPACITY_NAME), 0.15F, 70, -16777216, 2147483647, true, false);
drawY += 15;
if (this.recipe.hasCapacity())
{
assetManager.getFont().drawAutoScaledString((float) (this.x + 116 + offset), (float) (this.y + drawY), RockBottomAPI.getGame().getAssetManager().localize(CAPACITY_NAME), 0.15F, 70, -16777216, 2147483647, true, false);
drawY += 15;
}
if (this.recipe.hasEfficiency())
{
assetManager.getFont().drawAutoScaledString((float) (this.x + 116 + offset), (float) (this.y + drawY), RockBottomAPI.getGame().getAssetManager().localize(EFFICIENCY_NAME), 0.15F, 70, -16777216, 2147483647, true, false);
Expand Down Expand Up @@ -313,9 +316,12 @@ private void onRecipeChanged()

AssemblyRecipe r = this.recipe;
int progressY = 19;
this.stats.add(new ComponentProgressBar(this, 100 + offset, progressY, 33, 8, Color.DARK_GRAY.getRGB(), false, () -> ModUtils.getAssemblyCapacity(getTEItems())));
progressY += 15;

if (r.hasCapacity())
{
this.stats.add(new ComponentProgressBar(this, 100 + offset, progressY, 33, 8, Color.DARK_GRAY.getRGB(), false, () -> ModUtils.getAssemblyCapacity(getTEItems())));
progressY += 15;
}
if (r.hasEfficiency())
{
this.stats.add(new ComponentProgressBar(this, 100 + offset, progressY, 33, 8, Color.DARK_GRAY.getRGB(), false, () -> ModUtils.getAssemblyEfficiency(getTEItems())));
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/raphydaphy/rocksolid/init/ModRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ public static void init()
new AssemblyRecipe(0.6f, new ItemInstance(ModTiles.ELECTRIC_ALLOY_SMELTER), 35, 9, 10).registerAssembly();
new AssemblyRecipe(0.6f, new ItemInstance(ModTiles.ELECTRIC_BLAST_FURNACE), 50, 8, 20).registerAssembly();
new AssemblyRecipe(0.6f, new ItemInstance(ModTiles.ELECTRIC_COMPRESSOR), 70, 6, 8).registerAssembly();
new AssemblyRecipe(0.7f, new ItemInstance(ModTiles.REFINERY), 45, 12, 8).registerAssembly();
new AssemblyRecipe(0.6f, new ItemInstance(ModTiles.PUMP),40, 4, 8).disableEfficiency().registerAssembly();
new AssemblyRecipe(0.6f, new ResUseInfo(ModItems.RES_TITANIUM_PROCESSED, 15), new ItemInstance(ModTiles.NUCLEAR_REACTOR), 75, 10).registerAssembly();
new AssemblyRecipe(0.6f, new ResUseInfo(ModItems.RES_URANIUM_COMPRESSED, 4), new ItemInstance(ModItems.URANIUM_ROD), 16, 4).disableThroughput().disableSpeed().disableBonusYield().registerAssembly();
new AssemblyRecipe(0.6f, new ItemInstance(ModTiles.TEMPSHIFT_PLATE),50, 15, 5).disableBonusYield().disableEfficiency().disableSpeed().disableThroughput().registerAssembly();

// Temporary until precision assembler is done
new AssemblyRecipe(0.7f, new ResUseInfo(ModItems.RES_NICKEL_TUNGSTEN_CARBIDE_PROCESSED, 6), new ItemInstance(ModTiles.LAUNCH_PAD), 25, 3).disableSpeed().disableBonusYield().registerAssembly();
new AssemblyRecipe(0.7f, new ResUseInfo(ModItems.RES_NICKEL_TUNGSTEN_CARBIDE_PROCESSED, 18), new ItemInstance(ModItems.ROCKET), 50, 15).disableCapacity().disableBonusYield().disableSpeed().disableThroughput().disableEfficiency().registerAssembly();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

public class AssemblyRecipe extends BasicRecipe
{
private boolean capacity = true;
private boolean efficiency = true;
private boolean speed = true;
private boolean bonusYield = true;
Expand Down Expand Up @@ -50,6 +51,12 @@ public AssemblyRecipe registerAssembly()
return this;
}

public AssemblyRecipe disableCapacity()
{
capacity = false;
return this;
}

public AssemblyRecipe disableEfficiency()
{
efficiency = false;
Expand All @@ -74,6 +81,11 @@ public AssemblyRecipe disableThroughput()
return this;
}

public boolean hasCapacity()
{
return capacity;
}

public boolean hasEfficiency()
{
return efficiency;
Expand All @@ -99,7 +111,7 @@ public List<ItemInstance> getActualOutputs(IInventory inputInventory, IInventory
{
ItemInstance nbtOut = output.copy();

nbtOut.getOrCreateAdditionalData().addFloat(ModUtils.ASSEMBLY_CAPACITY_KEY, ModUtils.getAssemblyCapacity(inputs) * 2);
nbtOut.getOrCreateAdditionalData().addFloat(ModUtils.ASSEMBLY_CAPACITY_KEY, hasCapacity() ? ModUtils.getAssemblyCapacity(inputs) * 2 : -1);
nbtOut.getAdditionalData().addFloat(ModUtils.ASSEMBLY_EFFICIENCY_KEY, hasEfficiency() ? ModUtils.getAssemblyEfficiency(inputs) * 2 : -1);
nbtOut.getAdditionalData().addFloat(ModUtils.ASSEMBLY_SPEED_KEY, hasSpeed() ? ModUtils.getAssemblySpeed(inputs) * 2 : -1);
nbtOut.getAdditionalData().addFloat(ModUtils.ASSEMBLY_BONUS_KEY, hasBonusYield() ? ModUtils.getAssemblyBonusYield(inputs) * 2 : -1);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/rocksolid/loc/us_english.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"electric_alloy_smelter": "Electric Alloy Smelter",
"electric_blast_furnace": "Electric Blast Furnace",
"electric_compressor": "Electric Compressor",
"refinery": "Refinery",
"refinery": "Oil Refinery",
"launch_pad": "Rocket Launch Pad",
"rocket": "Rocket",
"moon.": {
Expand Down

0 comments on commit e1fbaff

Please sign in to comment.