Skip to content

Commit

Permalink
Port GT5u PR no. 2668 (casing bonus for CoAL) (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorbatron authored Oct 12, 2024
1 parent 66a9e3c commit 484000a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ protected void addDisplayText(List<ITextComponent> textList) {
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);

tooltip.add(I18n.format("zbgt.machine.coal.description.1"));
tooltip.add(I18n.format("zbgt.machine.coal.description.2"));
for (int i = 1; i <= 3; i++) {
tooltip.add(I18n.format(String.format("zbgt.machine.coal.description.%d", i)));
}
}

@Override
Expand All @@ -262,18 +263,19 @@ public IOpticalComputationProvider getComputationProvider() {

protected class CoALRecipeLogic extends ComputationRecipeLogic {

MetaTileEntityCoAL CoAL;

public CoALRecipeLogic(MetaTileEntityCoAL metaTileEntity) {
super(metaTileEntity, ComputationType.STEADY);
this.CoAL = metaTileEntity;
}

@Override
public boolean checkRecipe(@NotNull Recipe recipe) {
if (!super.checkRecipe(recipe)) return false;

return recipe.getProperty(CoALProperty.getInstance(), 0) <= tier;
int recipeCasingTier = recipe.getProperty(CoALProperty.getInstance(), 0);

setSpeedBonus(1 / Math.pow(2, tier - recipeCasingTier));

return recipeCasingTier <= tier;
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/zbgt/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ zbgt.machine.quacker.tooltip=A slightly larger oil cracker, although it may some
zbgt.machine.coal.name=Component Assembly Line
zbgt.machine.coal.description.1=Creates large batches of §fComponents§7 for §e75%%§7 of the Cost.
zbgt.machine.coal.description.2=Recipes are limited by §bCasing Tier§7.
zbgt.machine.coal.description.3=Each casing tier above the recipe §eHalves the recipe time§r.
zbgt.machine.coal.max_recipe_tier=Max Component Tier: %s
zbgt.machine.coal.max_recipe_tier.hover=The highest component tier that can be assembled
zbgt.machine.coal.computation_tier=Max Computation Available: %s
Expand Down

0 comments on commit 484000a

Please sign in to comment.