Skip to content

Commit

Permalink
fixes (#515)
Browse files Browse the repository at this point in the history
* fix: creative tab supplier was null with high tier config disabled

* fix: add circuit 2 to basic silicon boule

* fix: add recipe for item voiding cover

* fix: correctly determine multiblock max voltage

* fix: low pressure steam machines don't underclock

* chore: changelog

* refactor: make protected methods in TagPrefix public
  • Loading branch information
mikerooni authored Nov 4, 2023
1 parent a49be64 commit 1da3e08
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 48 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ChangeLog

* bump ldlib version up
* Bump ldlib version up
* Fix incorrect maximum voltage for multiblocks
* Fix crash on startup for 1.19
* Fix LP steam machines not running slower than HP steam machines
* Add missing recipe for item voiding cover
* Add circuit 2 to recipe for monocrystalline silicon boule
* Make protected methods in TagPrefix public
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.function.*;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Predicate;
import java.util.function.Supplier;

import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.Conditions.*;
import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.LoaderType.*;
import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.LoaderType.FABRIC;
import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.LoaderType.FORGE;

@Accessors(chain = true, fluent = true)
public class TagPrefix {
Expand Down Expand Up @@ -824,7 +828,7 @@ public TagPrefix(String name, boolean invertedName) {
PREFIXES.put(name, this);
}

protected static TagPrefix oreTagPrefix(String name) {
public static TagPrefix oreTagPrefix(String name) {
return new TagPrefix(name)
.prefixTagPath(FORGE, "ores/%s/%s")
.defaultTagPath(FORGE, "ores/%s")
Expand All @@ -841,27 +845,27 @@ public void addSecondaryMaterial(MaterialStack secondaryMaterial) {
secondaryMaterials.add(secondaryMaterial);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType) {
public TagPrefix registerOre(Supplier<BlockState> stoneType) {
return registerOre(stoneType, net.minecraft.world.level.material.Material.STONE);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether) {
public TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether) {
return registerOre(stoneType, isNether, net.minecraft.world.level.material.Material.STONE);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType, net.minecraft.world.level.material.Material material) {
public TagPrefix registerOre(Supplier<BlockState> stoneType, net.minecraft.world.level.material.Material material) {
return registerOre(stoneType, false, material);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether, net.minecraft.world.level.material.Material material) {
public TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether, net.minecraft.world.level.material.Material material) {
return registerOre(stoneType, false, material, material.getColor(), SoundType.STONE);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType, MaterialColor color) {
public TagPrefix registerOre(Supplier<BlockState> stoneType, MaterialColor color) {
return registerOre(stoneType, false, color);
}

protected TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether, MaterialColor color) {
public TagPrefix registerOre(Supplier<BlockState> stoneType, boolean isNether, MaterialColor color) {
return registerOre(stoneType, isNether, net.minecraft.world.level.material.Material.STONE, color, SoundType.STONE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import com.gregtechceu.gtceu.api.gui.fancy.IFancyUIProvider;
import com.gregtechceu.gtceu.api.gui.fancy.TooltipsPanel;
import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity;
import com.gregtechceu.gtceu.api.machine.feature.*;
import com.gregtechceu.gtceu.api.machine.feature.IFancyUIMachine;
import com.gregtechceu.gtceu.api.machine.feature.IOverclockMachine;
import com.gregtechceu.gtceu.api.machine.feature.ITieredMachine;
import com.gregtechceu.gtceu.api.machine.feature.multiblock.IDisplayUIMachine;
import com.gregtechceu.gtceu.api.machine.feature.multiblock.IMultiPart;
import com.gregtechceu.gtceu.utils.GTUtil;
Expand Down Expand Up @@ -212,6 +214,6 @@ public long getMaxHatchVoltage() {
}

public long getMaxVoltage() {
return getMaxHatchVoltage();
return GTValues.V[GTUtil.getFloorTierByVoltage(getMaxHatchVoltage())];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@
import com.gregtechceu.gtceu.api.machine.trait.NotifiableFluidTank;
import com.gregtechceu.gtceu.api.machine.trait.NotifiableItemStackHandler;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.OverclockingLogic;
import com.gregtechceu.gtceu.api.recipe.RecipeHelper;
import com.gregtechceu.gtceu.common.recipe.VentCondition;
import com.lowdragmc.lowdraglib.gui.modular.ModularUI;
import com.lowdragmc.lowdraglib.gui.widget.LabelWidget;
import com.lowdragmc.lowdraglib.side.fluid.FluidHelper;
import com.lowdragmc.lowdraglib.side.fluid.IFluidStorage;
import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer;
import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted;
import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder;
import com.lowdragmc.lowdraglib.utils.Position;
import it.unimi.dsi.fastutil.longs.LongIntMutablePair;
import lombok.Setter;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.Direction;
Expand Down Expand Up @@ -130,15 +127,14 @@ public static GTRecipe recipeModifier(MetaMachine machine, @Nonnull GTRecipe rec
return null;
}

var modified = RecipeHelper.applyOverclock(new OverclockingLogic((_recipe, recipeEUt, maxVoltage, duration, amountOC) ->
LongIntMutablePair.of(steamMachine.isHighPressure ? recipeEUt * 2 : recipeEUt, steamMachine.isHighPressure ? duration : duration * 2)),
recipe, GTValues.V[GTValues.LV]);
var modified = recipe.copy();
modified.conditions.add(VentCondition.INSTANCE);

if (modified == recipe) {
modified = recipe.copy();
if (!steamMachine.isHighPressure) {
modified.duration *= 2;
RecipeHelper.setInputEUt(modified, RecipeHelper.getInputEUt(recipe) / 2);
}

modified.conditions.add(VentCondition.INSTANCE);
return modified;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,13 @@
import com.gregtechceu.gtceu.api.item.RendererBlockItem;
import com.gregtechceu.gtceu.api.item.tool.GTToolType;
import com.gregtechceu.gtceu.api.pipenet.longdistance.LongDistancePipeBlock;
import com.gregtechceu.gtceu.api.pipenet.longdistance.LongDistancePipeType;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.api.data.tag.TagUtil;
import com.gregtechceu.gtceu.api.registry.registrate.CompassNode;
import com.gregtechceu.gtceu.api.registry.registrate.CompassSection;
import com.gregtechceu.gtceu.client.renderer.block.CTMModelRenderer;
import com.gregtechceu.gtceu.client.renderer.block.OreBlockRenderer;
import com.gregtechceu.gtceu.client.renderer.block.TextureOverrideRenderer;
import com.gregtechceu.gtceu.common.block.*;
import com.gregtechceu.gtceu.common.pipelike.fluidpipe.FluidPipeType;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey;
import com.gregtechceu.gtceu.api.item.MaterialBlockItem;
import com.gregtechceu.gtceu.api.item.tool.GTToolType;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.common.pipelike.cable.Insulation;
import com.gregtechceu.gtceu.common.pipelike.fluidpipe.FluidPipeType;
import com.gregtechceu.gtceu.common.pipelike.fluidpipe.longdistance.LDFluidPipeType;
Expand All @@ -44,9 +35,7 @@
import com.gregtechceu.gtceu.utils.FormattingUtil;
import com.lowdragmc.lowdraglib.Platform;
import com.lowdragmc.lowdraglib.client.renderer.IRenderer;
import com.tterrag.registrate.Registrate;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.providers.loot.RegistrateBlockLootTables;
import com.tterrag.registrate.util.entry.BlockEntry;
Expand All @@ -68,16 +57,12 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.FoliageColor;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.grower.AbstractTreeGrower;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.material.MaterialColor;
Expand All @@ -97,7 +82,8 @@
import java.util.function.Supplier;

import static com.gregtechceu.gtceu.api.GTValues.*;
import static com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags.*;
import static com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags.FORCE_GENERATE_BLOCK;
import static com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags.GENERATE_FRAME;
import static com.gregtechceu.gtceu.api.registry.GTRegistries.REGISTRATE;
import static com.gregtechceu.gtceu.common.data.GCyMBlocks.*;
import static net.minecraftforge.client.model.generators.ModelProvider.BLOCK_FOLDER;
Expand Down Expand Up @@ -606,7 +592,7 @@ private static BlockEntry<Block> createMachineCasingBlock(int tier) {
.item(RendererBlockItem::new)
.model(NonNullBiConsumer.noop());
if (!GTCEu.isHighTier() && tier > GTValues.UHV) {
entry.tab(null);
entry.tab(() -> null);
}
return entry.build().register();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private static void waferRecipes(Consumer<FinishedRecipe> provider) {
.inputItems(dust, Silicon, 32)
.inputItems(dustSmall, GalliumArsenide)
.outputItems(SILICON_BOULE)
.circuitMeta(2)
.blastFurnaceTemp(1784)
.duration(9000).EUt(VA[MV]).save(provider);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,15 @@ public static void init(Consumer<FinishedRecipe> provider) {

//Voiding Covers Start-----------------------------------------------------------------------------------------

// TODO Item pipes
//VanillaRecipeHelper.addShapedRecipe(provider, true, "cover_item_voiding", COVER_ITEM_VOIDING.asStack(), "SDS", "dPw", " E ", 'S', new UnificationEntry(screw, Steel), 'D', COVER_ITEM_DETECTOR.asStack(), 'P', new UnificationEntry(pipeNormalItem, Brass), 'E', Items.ENDER_PEARL);

//ASSEMBLER_RECIPES.recipeBuilder("cover_item_voiding")
// .inputItems(screw, Steel, 2)
// .inputItems(COVER_ITEM_DETECTOR)
// .inputItems(pipeNormalItem, Brass)
// .inputItems(Items.ENDER_PEARL)
// .outputItems(COVER_ITEM_VOIDING)
// .duration(100).EUt(VA[LV]).save(provider);
VanillaRecipeHelper.addShapedRecipe(provider, true, "cover_item_voiding", COVER_ITEM_VOIDING.asStack(), "SDS", "dPw", " E ", 'S', new UnificationEntry(screw, Steel), 'D', COVER_ITEM_DETECTOR.asStack(), 'P', new UnificationEntry(pipeNormalItem, Brass), 'E', Items.ENDER_PEARL);

ASSEMBLER_RECIPES.recipeBuilder("cover_item_voiding")
.inputItems(screw, Steel, 2)
.inputItems(COVER_ITEM_DETECTOR)
.inputItems(pipeNormalItem, Brass)
.inputItems(Items.ENDER_PEARL)
.outputItems(COVER_ITEM_VOIDING)
.duration(100).EUt(VA[LV]).save(provider);

ASSEMBLER_RECIPES.recipeBuilder("cover_item_voiding_advanced")
.inputItems(COVER_ITEM_VOIDING)
Expand Down

0 comments on commit 1da3e08

Please sign in to comment.