Skip to content

Commit

Permalink
Merge pull request #667 from Nxer/compressorTier
Browse files Browse the repository at this point in the history
add compressor recipe limitation to Space Scaler
  • Loading branch information
Nxer authored Dec 9, 2024
2 parents 05affee + b1dc9a3 commit 4487a8e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.recipe.check.CheckRecipeResultRegistry;
import gregtech.api.recipe.metadata.CompressionTierKey;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;
import gregtech.api.util.HatchElementBuilder;
import gregtech.api.util.MultiblockTooltipBuilder;
Expand Down Expand Up @@ -198,6 +200,17 @@ public CheckRecipeResult process() {
return super.process();
}

@NotNull
@Override
protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) {

int recipeReq = 1 + recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0);
if (recipeReq > fieldGeneratorTier) {
return CheckRecipeResultRegistry.insufficientMachineTier(recipeReq);
}
return super.validateRecipe(recipe);
}

}.setMaxParallelSupplier(this::getMaxParallelRecipes);
}

Expand Down Expand Up @@ -420,6 +433,7 @@ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasing

@Override
protected MultiblockTooltipBuilder createTooltip() {
// spotless:off
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType(TextLocalization.Tooltip_SpaceScaler_MachineType)
.addInfo(TextLocalization.Tooltip_SpaceScaler_00)
Expand All @@ -431,6 +445,10 @@ protected MultiblockTooltipBuilder createTooltip() {
.addInfo(TextLocalization.Tooltip_SpaceScaler_06)
.addInfo(TextEnums.tr("Tooltip_SpaceScaler_07"))
.addInfo(TextLocalization.Tooltip_SpaceScaler_08)
// #tr Tooltip_SpaceScaler_09
// # T2 block unlock HIP Unit limitation, T3 block unlock Stabilized Black Hole limitation.
// #zh_CN 2级方块解锁HIP单元限制, 3级解锁稳定黑洞限制.
.addInfo(TextEnums.tr("Tooltip_SpaceScaler_09"))
.addInfo(TextLocalization.textScrewdriverChangeMode)
.addSeparator()
.addInfo(TextLocalization.StructureTooComplex)
Expand All @@ -443,6 +461,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addEnergyHatch(TextLocalization.textUseBlueprint, 2)
.toolTipFinisher(TextLocalization.ModName);
return tt;
// spotless:on
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/gtnhcommunitymod/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1556,3 +1556,4 @@ Tooltip_MegaStoneBreaker_Hatch_0=§fLava Hatch:{GREEN\} Left§7 side of Structur
Tooltip_MegaStoneBreaker_Hatch_1=§fWater Hatch:{GREEN\} Right§7 side of Structure
tst.recipe.MegaStoneBreakerRecipes=Mega Stone Breaker
NameMegaStoneBreaker=Silicon Rock Synthesizer
Tooltip_SpaceScaler_09=T2 block unlock HIP Unit limitation, T3 block unlock Stabilized Black Hole limitation.
1 change: 1 addition & 0 deletions src/main/resources/assets/gtnhcommunitymod/lang/zh_CN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1556,3 +1556,4 @@ Tooltip_MegaStoneBreaker_Hatch_0=§f岩浆输入仓:§7结构的§a左§7侧
Tooltip_MegaStoneBreaker_Hatch_1=§f水输入仓:§7结构的§a右§7侧
tst.recipe.MegaStoneBreakerRecipes=巨型碎石机
NameMegaStoneBreaker=硅岩制造机
Tooltip_SpaceScaler_09=2级方块解锁HIP单元限制, 3级解锁稳定黑洞限制.

0 comments on commit 4487a8e

Please sign in to comment.