-
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
10 changed files
with
106 additions
and
10 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
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
48 changes: 48 additions & 0 deletions
48
src/main/java/reobf/proghatches/eucrafting/TileCraftingMinimiumEUTile.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,48 @@ | ||
package reobf.proghatches.eucrafting; | ||
|
||
import java.lang.invoke.MethodHandle; | ||
import java.lang.invoke.MethodHandles.Lookup; | ||
import static reobf.proghatches.eucrafting.TileCraftingMinimiumEUTile.Scope.*; | ||
import appeng.me.cluster.IAECluster; | ||
import appeng.me.cluster.implementations.CraftingCPUCluster; | ||
import appeng.tile.TileEvent; | ||
import appeng.tile.crafting.TileCraftingTile; | ||
import appeng.tile.events.TileEventType; | ||
|
||
public class TileCraftingMinimiumEUTile extends TileCraftingTile{ | ||
public static class Scope{ | ||
public static void setScope(Lookup lup){ | ||
scope=lup; | ||
try { | ||
isComplete = scope.findGetter(CraftingCPUCluster.class,"isComplete", boolean.class); | ||
} catch (Exception e) { | ||
|
||
throw new AssertionError(e); | ||
} | ||
}; | ||
public static Lookup scope; | ||
public static MethodHandle isComplete; | ||
} | ||
|
||
|
||
public CraftingCPUCluster getCraftingCluster() { | ||
return (CraftingCPUCluster) this.getCluster(); | ||
} | ||
@TileEvent(TileEventType .TICK) | ||
public void tick(){try { | ||
CraftingCPUCluster cluster = getCraftingCluster(); | ||
if(cluster==null)return; | ||
if(cluster.getRemainingOperations()==0)return; | ||
|
||
isComplete.invoke(cluster); | ||
|
||
|
||
|
||
} catch (Throwable e) {e.printStackTrace();} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
} |
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/reobf/proghatches/main/mixin/mixins/eucrafting/MixinCpuClusterAccess.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,17 @@ | ||
package reobf.proghatches.main.mixin.mixins.eucrafting; | ||
|
||
import java.lang.invoke.MethodHandles; | ||
import java.lang.invoke.MethodHandles.Lookup; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
|
||
import appeng.me.cluster.implementations.CraftingCPUCluster; | ||
import reobf.proghatches.eucrafting.TileCraftingMinimiumEUTile; | ||
@Mixin(value = CraftingCPUCluster.class, remap = false, priority = 0) | ||
public class MixinCpuClusterAccess { | ||
|
||
static{ TileCraftingMinimiumEUTile.Scope.setScope(MethodHandles.lookup()); | ||
} | ||
|
||
} |
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