Skip to content

Commit

Permalink
add mixin AE2FC GT integration
Browse files Browse the repository at this point in the history
  • Loading branch information
aagrishankov committed Dec 17, 2023
1 parent f50d7a6 commit da742ca
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
Binary file added libs/ae2fc-1.1.73-gtnh-dev.jar
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
repositories {
maven {
name = "ic2"
url = "https://maven.ic2.player.to/"
url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum Mixin {
ItemIC2FluidContainer_Mixin("ic2.ItemIC2FluidContainer_Mixin", IC2),

MovableTileRegistry_Mixin("ae2.MovableTileRegistry_Mixin", AE, GREGTECH, VANILLA),
AEFC_GT_Fix_Mixin("ae2.MovableTileRegistry_Mixin", AE2FC, AE, GREGTECH, VANILLA),

ForgeHooksClient_Mixin("vanilla.ForgeHooksClient_Mixin", VANILLA),
BlockHopper_Mixin("vanilla.BlockHopper_Mixin", VANILLA),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public enum TargetedMod {
GREGTECH("GregTech", "gregtech", true),
IC2("IndustrialCraft 2", "industrialcraft", true),
AE("Applied Energistics 2", "appliedenergistics2", true),
AE2FC("Fluid Craft For AE2", "ae2fc", true),
COFH("CoFHCore", "CoFHCore", true),
;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package space.gtimpact.mixinmodule.mixins.ae2;

import com.glodblock.github.inventory.FluidConvertingInventoryAdaptor;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(FluidConvertingInventoryAdaptor.class)
public class AEFC_GT_Fix_Mixin {

@Inject(method = "checkGTPipeConnection", at = @At("HEAD"), remap = false, cancellable = true)
private void checkGTPipeConnection(TileEntity te, ForgeDirection direction, CallbackInfoReturnable<Boolean> cir) {
if (te instanceof IGregTechTileEntity) {
IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity();
if (mte instanceof MetaPipeEntity) {
cir.setReturnValue(((MetaPipeEntity) mte).isConnectedAtSide(direction.ordinal()));
}
}
cir.setReturnValue(true);
}
}

0 comments on commit da742ca

Please sign in to comment.