Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Fix MDT void protection (#367)
Browse files Browse the repository at this point in the history
* Update buildscript.

* Implement custom MDT logic for dumping fluid to ME.

* Code cleanup.
  • Loading branch information
MarchingCube authored Nov 13, 2023
1 parent d8f761d commit ce23379
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1697697256
//version: 1699290261
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -646,7 +646,7 @@ repositories {

def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.7.1"
def mixinProviderVersion = "0.1.13"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
Expand Down Expand Up @@ -1187,9 +1187,8 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
}
}

repositories {
if (usesMavenPublishing.toBoolean()) {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven {
url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME;

public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaDistillTower>
implements ISurvivalConstructable {
Expand Down Expand Up @@ -376,6 +377,30 @@ protected ProcessingLogic createProcessingLogic() {
return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax);
}

@Override
public boolean canDumpFluidToME() {

// All fluids can be dumped to ME only if each layer contains a ME Output Hatch.
for (List<GT_MetaTileEntity_Hatch_Output> tLayerOutputHatches : this.mOutputHatchesByLayer) {

boolean foundMEHatch = false;

for (IFluidStore tHatch : tLayerOutputHatches) {
if (tHatch instanceof GT_MetaTileEntity_Hatch_Output_ME) {
foundMEHatch = true;
break;
}
}

// Exit if we didn't find a valid hatch on this layer.
if (!foundMEHatch) {
return false;
}
}

return true;
}

@Override
protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
for (int i = 0; i < mOutputFluids2.length && i < this.mOutputHatchesByLayer.size(); i++) {
Expand Down

0 comments on commit ce23379

Please sign in to comment.