aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authorMary <33456283+FourIsTheNumber@users.noreply.github.com>2024-10-13 09:24:09 -0400
committerGitHub <noreply@github.com>2024-10-13 13:24:09 +0000
commit356450db6bdd5498759eb46ce666f81087932688 (patch)
tree0cb8c902eee7517cffc8ce24fd044a4b2d57fedc /src/main/java/gregtech/common/tileentities/machines/multi
parentf5ecf4191ee044b835d17a4c9767164cdb53ff2d (diff)
downloadGT5-Unofficial-356450db6bdd5498759eb46ce666f81087932688.tar.gz
GT5-Unofficial-356450db6bdd5498759eb46ce666f81087932688.tar.bz2
GT5-Unofficial-356450db6bdd5498759eb46ce666f81087932688.zip
Blackhole fixes (#3363)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java
index 35080a329c..09dbf808fd 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java
@@ -69,7 +69,6 @@ import gregtech.api.recipe.RecipeMap;
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;
@@ -338,7 +337,7 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
+ EnumChatFormatting.GRAY
+ " until it reaches 0")
.addInfo("At 0 stability, the black hole is " + EnumChatFormatting.DARK_RED + "UNSTABLE")
- .addInfo("Once the black hole becomes unstable, it will void all inputs for recipes which require it")
+ .addInfo("Once the black hole becomes unstable, it will void all inputs instantly!")
.addSeparator()
.addInfo("Running recipes in the machine will slow the decay rate by " + EnumChatFormatting.RED + "25%")
.addInfo(
@@ -363,11 +362,6 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
+ " to close the black hole")
.addInfo("To restore stability and reset spacetime costs, close the black hole and open a new one")
.addSeparator()
- .addInfo(
- "Recipes not utilizing the black hole have their lengths " + EnumChatFormatting.RED
- + "doubled"
- + EnumChatFormatting.GRAY
- + " if it becomes unstable")
.addInfo("400% faster than singleblock machines of the same voltage")
.addInfo("Only uses 70% of the EU/t normally required")
.addInfo("Gains 8 parallels per voltage tier")
@@ -381,8 +375,13 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
.addInfo(
EnumChatFormatting.RED
+ "Recipe tier is limited to hatch tier + 1. Will not perform overclocks above the hatch tier.")
- .addInfo(AuthorFourIsTheNumber + EnumChatFormatting.RESET + " & " + Ollie)
- .addInfo("Rendering by: " + EnumChatFormatting.WHITE + "BucketBrigade")
+ .addInfo(
+ AuthorFourIsTheNumber + EnumChatFormatting.RESET
+ + " & "
+ + Ollie
+ + " & "
+ + EnumChatFormatting.WHITE
+ + "BucketBrigade")
.addSeparator()
.beginStructureBlock(35, 33, 35, false)
.addCasingInfoMin("Background Radiation Absorbent Casing", 950, false)
@@ -526,10 +525,17 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
protected Stream<GTRecipe> findRecipeMatches(@Nullable RecipeMap<?> map) {
searchAndDecrementCatalysts();
- RecipeMap<?> realMap = (getModeFromCircuit(inputItems) == MACHINEMODE_COMPRESSOR)
- ? RecipeMaps.compressorRecipes
- : RecipeMaps.neutroniumCompressorRecipes;
- return super.findRecipeMatches(realMap);
+ switch (getModeFromCircuit(inputItems)) {
+ case MACHINEMODE_COMPRESSOR -> {
+ return super.findRecipeMatches(RecipeMaps.compressorRecipes);
+ }
+ case MACHINEMODE_BLACKHOLE -> {
+ return super.findRecipeMatches(RecipeMaps.neutroniumCompressorRecipes);
+ }
+ default -> {
+ return super.findRecipeMatches(null);
+ }
+ }
}
@NotNull
@@ -554,16 +560,8 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
@NotNull
@Override
protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) {
-
- // Default speed bonus
- setSpeedBonus(0.2F);
if (blackHoleStatus == 1) return CheckRecipeResultRegistry.NO_BLACK_HOLE;
- // If the recipe doesn't require black hole, but it is unstable, incur a 0.5x speed penalty
- if (recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0) == 0 && (blackHoleStatus == 3)) {
- setSpeedBonus(5F);
- }
-
// Cap recipes to energy hatch + 1
if (GTUtility.getTier(getAverageInputVoltage()) < GTUtility.getTier(recipe.mEUt) - 1)
return CheckRecipeResultRegistry.insufficientPower(recipe.mEUt);
@@ -573,13 +571,14 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl
@Nonnull
protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) {
// If recipe needs a black hole and one is active but unstable, continuously void items
- if ((blackHoleStatus == 3) && recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0) > 0) {
+ if (blackHoleStatus == 3) {
return CheckRecipeResultRegistry.UNSTABLE_BLACK_HOLE;
}
return CheckRecipeResultRegistry.SUCCESSFUL;
}
}.setMaxParallelSupplier(this::getMaxParallelRecipes)
- .setEuModifier(0.7F);
+ .setEuModifier(0.7F)
+ .setSpeedBonus(0.2F);
}
@Override