-
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.
Enabled debug verbose again
- Loading branch information
Showing
8 changed files
with
105 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/net/heyzeer0/mgh/mixins/ae2/MixinTickHandler.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,26 @@ | ||
package net.heyzeer0.mgh.mixins.ae2; | ||
|
||
import appeng.hooks.TickHandler; | ||
import appeng.util.IWorldCallable; | ||
import net.heyzeer0.mgh.MagiHandlers; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
/** | ||
* Created by Frani on 18/02/2018. | ||
*/ | ||
@Mixin(value = TickHandler.class, remap = false) | ||
public abstract class MixinTickHandler { | ||
|
||
@Redirect(method = "processQueue", at = @At(value = "INVOKE", target = "Lappeng/util/IWorldCallable;call(Lnet/minecraft/world/World;)Ljava/lang/Object;")) | ||
private Object redirectCall(IWorldCallable c, World world) throws Exception { | ||
final boolean isIgnoring = MagiHandlers.getStack().ignorePhase; | ||
MagiHandlers.getStack().ignorePhase = true; | ||
Object r = c.call(world); | ||
MagiHandlers.getStack().ignorePhase = isIgnoring; | ||
return r; | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/net/heyzeer0/mgh/mixins/forestry/MixinTileFarmGearbox.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,24 @@ | ||
package net.heyzeer0.mgh.mixins.forestry; | ||
|
||
import forestry.api.farming.IFarmHousing; | ||
import forestry.farming.tiles.TileFarmGearbox; | ||
import net.heyzeer0.mgh.MagiHandlers; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
/** | ||
* Created by Frani on 18/02/2018. | ||
*/ | ||
@Mixin(value = TileFarmGearbox.class, remap = false) | ||
public abstract class MixinTileFarmGearbox { | ||
|
||
@Redirect(method = "updateServer", at = @At(value = "INVOKE", target = "Lforestry/api/farming/IFarmHousing;doWork()Z")) | ||
private boolean redirectDoWork(IFarmHousing instance) { | ||
MagiHandlers.getStack().push(instance); | ||
boolean value = instance.doWork(); | ||
MagiHandlers.getStack().remove(instance); | ||
return value; | ||
} | ||
|
||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/net/heyzeer0/mgh/mixins/ic2/MixinTileEntityElectricMachine.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,33 @@ | ||
package net.heyzeer0.mgh.mixins.ic2; | ||
|
||
import cpw.mods.fml.common.eventhandler.Event; | ||
import cpw.mods.fml.common.eventhandler.EventBus; | ||
import ic2.core.block.machine.tileentity.TileEntityElectricMachine; | ||
import net.heyzeer0.mgh.MagiHandlers; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
/** | ||
* Created by Frani on 18/02/2018. | ||
*/ | ||
@Mixin(value = TileEntityElectricMachine.class, remap = false) | ||
public abstract class MixinTileEntityElectricMachine { | ||
|
||
@Redirect(method = "onLoaded", at = @At(value = "INVOKE", target = "Lcpw/mods/fml/common/eventhandler/EventBus;post(Lcpw/mods/fml/common/eventhandler/Event;)Z")) | ||
private boolean onPost(EventBus bus, Event toPost) { | ||
MagiHandlers.getStack().push(this); | ||
boolean r = bus.post(toPost); | ||
MagiHandlers.getStack().remove(this); | ||
return r; | ||
} | ||
|
||
@Redirect(method = "onUnloaded", at = @At(value = "INVOKE", target = "Lcpw/mods/fml/common/eventhandler/EventBus;post(Lcpw/mods/fml/common/eventhandler/Event;)Z")) | ||
private boolean onPostUnload(EventBus bus, Event toPost) { | ||
MagiHandlers.getStack().push(this); | ||
boolean r = bus.post(toPost); | ||
MagiHandlers.getStack().remove(this); | ||
return r; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"required": true, | ||
"package": "net.heyzeer0.mgh.mixins.forestry", | ||
"mixins": [ | ||
"MixinTileFarmGearbox" | ||
], | ||
"server": [], | ||
"client": [], | ||
"compatibilityLevel": "JAVA_8", | ||
"refmap": "mixin.magihandlers.refmap.json" | ||
} |
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