-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows AE2FC Interfaces to convert P2P Tunnels, closes #73
- Loading branch information
Showing
16 changed files
with
118 additions
and
50 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
19 changes: 19 additions & 0 deletions
19
src/main/java/co/neeve/nae2/common/api/TunnelConversionAPI.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,19 @@ | ||
package co.neeve.nae2.common.api; | ||
|
||
import appeng.util.item.ItemStackHashStrategy; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class TunnelConversionAPI { | ||
private final Object2ObjectMap<ItemStack, ItemStack> tunnelMap = | ||
new Object2ObjectOpenCustomHashMap<>(ItemStackHashStrategy.comparingAllButCount()); | ||
|
||
public void register(ItemStack catalyst, ItemStack tunnelStack) { | ||
this.tunnelMap.put(catalyst, tunnelStack); | ||
} | ||
|
||
public ItemStack getConversion(ItemStack catalyst) { | ||
return this.tunnelMap.getOrDefault(catalyst, ItemStack.EMPTY); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/co/neeve/nae2/common/integration/ae2fc/AE2FC.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 co.neeve.nae2.common.integration.ae2fc; | ||
|
||
import co.neeve.nae2.NAE2; | ||
import co.neeve.nae2.common.registration.definitions.Upgrades; | ||
import com.glodblock.github.loader.FCBlocks; | ||
import com.glodblock.github.loader.FCItems; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
|
||
public class AE2FC { | ||
|
||
public static void initInterfaceUpgrade(Upgrades.UpgradeType upgrade) { | ||
upgrade.registerItem(new ItemStack(FCBlocks.DUAL_INTERFACE), 1); | ||
upgrade.registerItem(new ItemStack(FCItems.PART_DUAL_INTERFACE), 1); | ||
} | ||
|
||
public static void postInit(Side side) { | ||
NAE2.definitions().parts().p2pTunnelInterface().maybeStack(1).ifPresent((p2pTunnel) -> { | ||
var tc = NAE2.api().tunnelConversion(); | ||
tc.register(new ItemStack(FCBlocks.DUAL_INTERFACE), p2pTunnel); | ||
tc.register(new ItemStack(FCItems.PART_DUAL_INTERFACE), p2pTunnel); | ||
}); | ||
} | ||
} |
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
15 changes: 0 additions & 15 deletions
15
src/main/java/co/neeve/nae2/common/integration/ae2fc/UpgradeInit.java
This file was deleted.
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
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
2 changes: 1 addition & 1 deletion
2
...erntransform/MixinCraftingCPUCluster.java → ...erntransform/MixinCraftingCPUCluster.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
2 changes: 1 addition & 1 deletion
2
...g/patterntransform/MixinCraftingGrid.java → ...g/patterntransform/MixinCraftingGrid.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
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