-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fluid conduit connecting to non-fluid GT tiles
Co-Authored-By: miozune <[email protected]>
- Loading branch information
1 parent
19de0c1
commit fe56af4
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
dependencies { | ||
implementation("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") | ||
api('com.github.GTNewHorizons:EnderCore:0.3.0:dev') | ||
implementation("com.github.GTNewHorizons:EnderIO:2.4.16:dev") | ||
implementation("curse.maven:cofh-core-69162:2388751") | ||
implementation(fileTree(dir: 'libs/', include: '*.jar')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/space/gtimpact/mixinmodule/mixins/ei/AbstractLiquidConduit_Mixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package space.gtimpact.mixinmodule.mixins.ei; | ||
|
||
import crazypants.enderio.conduit.liquid.AbstractLiquidConduit; | ||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity; | ||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; | ||
import net.minecraftforge.common.util.ForgeDirection; | ||
import net.minecraftforge.fluids.IFluidHandler; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(AbstractLiquidConduit.class) | ||
public abstract class AbstractLiquidConduit_Mixin { | ||
|
||
@Shadow(remap = false) public abstract IFluidHandler getExternalHandler(ForgeDirection direction); | ||
|
||
@Inject(method = "canConnectToExternal", at = @At("HEAD"), remap = false, cancellable = true) | ||
private void canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled, CallbackInfoReturnable<Boolean> cir) { | ||
IFluidHandler h = getExternalHandler(direction); | ||
if (h == null) { | ||
cir.setReturnValue(false); | ||
return; | ||
} | ||
|
||
if (h instanceof IGregTechTileEntity) { | ||
IMetaTileEntity mte = ((IGregTechTileEntity) h).getMetaTileEntity(); | ||
cir.setReturnValue(mte != null && mte.getCapacity() > 0); | ||
return; | ||
} | ||
cir.setReturnValue(true); | ||
} | ||
} |