-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
2,496 additions
and
1,218 deletions.
There are no files selected for viewing
540 changes: 540 additions & 0 deletions
540
src/main/java/reobf/proghatches/gt/metatileentity/DecoyInputBusME.java
Large diffs are not rendered by default.
Oops, something went wrong.
516 changes: 516 additions & 0 deletions
516
src/main/java/reobf/proghatches/gt/metatileentity/DecoyInputHatchME.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
12 changes: 12 additions & 0 deletions
12
src/main/java/reobf/proghatches/gt/metatileentity/util/IMEHatchOverrided.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,12 @@ | ||
package reobf.proghatches.gt.metatileentity.util; | ||
|
||
import appeng.api.config.Actionable; | ||
import appeng.api.networking.security.BaseActionSource; | ||
import appeng.api.storage.IMEMonitor; | ||
import appeng.api.storage.data.IAEStack; | ||
|
||
public interface IMEHatchOverrided { | ||
public void overridedBehoviour(int minPull); | ||
|
||
public IAEStack overridedExtract(IMEMonitor thiz, IAEStack request, Actionable mode, BaseActionSource src); | ||
} |
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
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
80 changes: 80 additions & 0 deletions
80
src/main/java/reobf/proghatches/main/mixin/mixins/part2/MixinMEBusOverride.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,80 @@ | ||
package reobf.proghatches.main.mixin.mixins.part2; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
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.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import appeng.api.config.Actionable; | ||
import appeng.api.networking.security.BaseActionSource; | ||
import appeng.api.storage.IMEMonitor; | ||
import appeng.api.storage.data.IAEItemStack; | ||
import appeng.api.storage.data.IAEStack; | ||
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_InputBus_ME; | ||
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Input_ME; | ||
import reobf.proghatches.gt.metatileentity.util.IMEHatchOverrided; | ||
|
||
@Mixin(remap=false,value={GT_MetaTileEntity_Hatch_InputBus_ME.class, | ||
GT_MetaTileEntity_Hatch_Input_ME.class, | ||
|
||
}) | ||
public class MixinMEBusOverride { | ||
private static Field minAutoPullStackSize; | ||
private static Field minAutoPullAmount; | ||
static { | ||
|
||
try { | ||
minAutoPullStackSize= GT_MetaTileEntity_Hatch_InputBus_ME.class.getDeclaredField("minAutoPullStackSize"); | ||
minAutoPullAmount= GT_MetaTileEntity_Hatch_Input_ME.class.getDeclaredField("minAutoPullAmount"); | ||
|
||
minAutoPullAmount.setAccessible(true); | ||
minAutoPullStackSize.setAccessible(true); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
|
||
} | ||
|
||
} | ||
|
||
@Inject(method={"refreshItemList" | ||
,"refreshFluidList" | ||
},cancellable=true,at = { @At("HEAD") }) | ||
private void refreshItemList(CallbackInfo ci) { | ||
if(this instanceof IMEHatchOverrided){ | ||
try { | ||
((IMEHatchOverrided)this).overridedBehoviour( | ||
( (Object)this instanceof GT_MetaTileEntity_Hatch_InputBus_ME? | ||
minAutoPullStackSize:minAutoPullAmount) | ||
|
||
.getInt(this)); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
ci.cancel(); | ||
} | ||
|
||
} | ||
|
||
@Redirect(method="endRecipeProcessing" | ||
, | ||
|
||
at = @At(value="INVOKE", | ||
target = "extractItems", | ||
remap = false | ||
)) | ||
private IAEStack r(IMEMonitor thiz,IAEStack request, Actionable mode, BaseActionSource src) { | ||
if(this instanceof IMEHatchOverrided){ | ||
return ((IMEHatchOverrided)this).overridedExtract(thiz,request,mode,src); | ||
|
||
} | ||
|
||
return (IAEStack) thiz.extractItems(request, mode, src); | ||
|
||
|
||
} | ||
|
||
} |
Oops, something went wrong.