Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GT 2.8.X #60

Merged
merged 6 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@
## v1.2.5

* Fixed missing recipes due to materials missing double plates (#56)

## v1.2.6

* Added compat for GTCEu 2.8
* Limited multiblock Assembler and Circuit Assembler to 1 energy hatch
* Updated molten fluid cooling recipes to respect freezer energy and duration overrides
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ dependencies {
// therefore we manually deobf the regular jar
implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") // CCL 3.2.3.358
// manually deobf the jar to prevent extra configuration for handling obf/deobf separation
implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4637703-deobf-4637704-sources-4637705")
implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4904269-deobf-4904270-sources-4904271")

// Soft Dependencies
implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.684"
implementation rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31
implementation rfg.deobf("curse.maven:groovyscript-687577:4610037") // GRS 0.5.1
implementation rfg.deobf("curse.maven:groovyscript-687577:4687204") // GRS 0.6.0
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import gregtech.GTInternalTags;

import gregicality.GCYMInternalTags;
import gregicality.multiblocks.api.fluids.GCYMMetaFluids;
import gregicality.multiblocks.api.utils.GCYMLog;
import gregicality.multiblocks.common.CommonProxy;
import gregicality.multiblocks.common.block.GCYMMetaBlocks;
Expand All @@ -34,7 +33,6 @@ public class GregicalityMultiblocks {
public void onPreInit(@NotNull FMLPreInitializationEvent event) {
GCYMLog.init(event.getModLog());

GCYMMetaFluids.init();
GCYMMetaBlocks.init();
GCYMMetaTileEntities.init();

Expand Down
29 changes: 0 additions & 29 deletions src/main/java/gregicality/multiblocks/api/AlloyBlastUtil.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ public int getParallelLimit() {
}

@Override
protected long getMaxVoltage() {
public long getMaxVoltage() {
if (!GCYMConfigHolder.globalMultiblocks.enableTieredCasings)
return super.getMaxVoltage();

if (getMetaTileEntity() instanceof GCYMRecipeMapMultiblockController &&
!((GCYMRecipeMapMultiblockController) getMetaTileEntity()).isTiered())
if (getMetaTileEntity() instanceof GCYMRecipeMapMultiblockController controller && !controller.isTiered())
return super.getMaxVoltage();

List<ITieredMetaTileEntity> list = getMetaTileEntity().getAbilities(GCYMMultiblockAbility.TIERED_HATCH);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package gregicality.multiblocks.api.fluids;

import static gregicality.multiblocks.api.utils.GCYMUtil.gcymId;

import gregtech.api.fluids.store.FluidStorageKey;

import gregicality.multiblocks.api.unification.material.GCYMMaterialIconTypes;
import gregicality.multiblocks.api.unification.properties.GCYMPropertyKey;

public final class GCYMFluidStorageKeys {

public static final FluidStorageKey MOLTEN = new FluidStorageKey(gcymId("molten"),
GCYMMaterialIconTypes.molten,
s -> "molten." + s,
m -> {
if (m.hasProperty(GCYMPropertyKey.ALLOY_BLAST)) {
return "gcym.fluid.molten";
}
return "gregtech.fluid.generic";
});

private GCYMFluidStorageKeys() {}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package gregicality.multiblocks.api.fluids;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import gregtech.api.GregTechAPI;
import gregtech.api.fluids.FluidBuilder;
import gregtech.api.fluids.store.FluidStorageKeys;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.properties.BlastProperty;
import gregtech.api.unification.material.properties.FluidProperty;
import gregtech.api.unification.material.properties.PropertyKey;

import gregicality.multiblocks.api.unification.GCYMMaterialFlags;
import gregicality.multiblocks.api.unification.properties.AlloyBlastProperty;
import gregicality.multiblocks.api.unification.properties.GCYMPropertyKey;

/**
* Handles generation of fluids based on material properties
*/
@ApiStatus.Internal
public final class GeneratedFluidHandler {

private GeneratedFluidHandler() {}

public static void init() {
for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) {
createMoltenFluid(material);
}
}

public static void createMoltenFluid(@NotNull Material material) {
// ignore materials set not to be alloy blast handled
if (material.hasFlag(GCYMMaterialFlags.DISABLE_ALLOY_PROPERTY)) return;

// ignore materials which are not alloys
if (material.getMaterialComponents().size() <= 1) return;

BlastProperty blastProperty = material.getProperty(PropertyKey.BLAST);
if (blastProperty == null) return;

AlloyBlastProperty alloyBlastProperty = material.getProperty(GCYMPropertyKey.ALLOY_BLAST);
if (alloyBlastProperty == null) return;

FluidProperty fluidProperty = material.getProperty(PropertyKey.FLUID);
if (fluidProperty == null) return;

if (alloyBlastProperty.shouldGenerateMolten(material)) {
fluidProperty.getStorage().enqueueRegistration(GCYMFluidStorageKeys.MOLTEN, new FluidBuilder()
.temperature(alloyBlastProperty.getTemperature()));
} else {
// not hot enough to produce molten fluid, so produce regular fluid
fluidProperty.getStorage().store(GCYMFluidStorageKeys.MOLTEN, material.getFluid(FluidStorageKeys.LIQUID));
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import gregtech.api.GTValues;
import gregtech.api.metatileentity.ITieredMetaTileEntity;
import gregtech.api.metatileentity.multiblock.MultiMapMultiblockController;
import gregtech.api.metatileentity.multiblock.MultiblockDisplayText;
import gregtech.api.pattern.TraceabilityPredicate;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;

import gregicality.multiblocks.api.capability.IParallelMultiblock;
import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic;
Expand Down Expand Up @@ -45,14 +47,26 @@ public void addInformation(ItemStack stack, @Nullable World player, List<String>

@Override
protected void addDisplayText(List<ITextComponent> textList) {
super.addDisplayText(textList);
List<ITieredMetaTileEntity> list = getAbilities(GCYMMultiblockAbility.TIERED_HATCH);
if (GCYMConfigHolder.globalMultiblocks.enableTieredCasings && !list.isEmpty()) {
long maxVoltage = Math.min(GTValues.V[list.get(0).getTier()],
Math.max(energyContainer.getInputVoltage(), energyContainer.getOutputVoltage()));
String voltageName = GTValues.VNF[list.get(0).getTier()];
textList.add(new TextComponentTranslation("gcym.multiblock.tiered_hatch.tooltip", maxVoltage, voltageName));
}
MultiblockDisplayText.builder(textList, isStructureFormed())
.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive())
.addEnergyUsageLine(getEnergyContainer())
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage()))
.addCustom(tl -> {
// Tiered Hatch Line
if (isStructureFormed()) {
List<ITieredMetaTileEntity> list = getAbilities(GCYMMultiblockAbility.TIERED_HATCH);
if (GCYMConfigHolder.globalMultiblocks.enableTieredCasings && !list.isEmpty()) {
long maxVoltage = Math.min(GTValues.V[list.get(0).getTier()],
Math.max(energyContainer.getInputVoltage(), energyContainer.getOutputVoltage()));
String voltageName = GTValues.VNF[list.get(0).getTier()];
tl.add(new TextComponentTranslation("gcym.multiblock.tiered_hatch.tooltip", maxVoltage,
voltageName));
}
}
})
.addParallelsLine(recipeMapWorkable.getParallelLimit())
.addWorkingStatusLine()
.addProgressLine(recipeMapWorkable.getProgressPercent());
}

@Override
Expand Down
Loading