diff --git a/gradle.properties b/gradle.properties index da0cbec..f18fa29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -modVersion = 0.8r31 +modVersion = 0.8r32 mcVersion = 1.7.10 forgeVersion = 10.13.2.1235 diff --git a/src/main/java/vic/mod/integratedcircuits/gate/BPDevice.java b/src/main/java/vic/mod/integratedcircuits/gate/BPDevice.java index 89fb2c4..924a40c 100644 --- a/src/main/java/vic/mod/integratedcircuits/gate/BPDevice.java +++ b/src/main/java/vic/mod/integratedcircuits/gate/BPDevice.java @@ -112,7 +112,7 @@ public IConnectionCache getRedstoneConnectionCache() @Override public byte getRedstonePower(ForgeDirection side) { - return (byte) (gate.getRedstoneOutput(gate.getSideRel(side.ordinal())) != 0 ? -1 : 0); + return (byte)(gate.getRedstoneOutput(gate.getSideRel(side.ordinal())) != 0 ? -1 : 0); } @Override diff --git a/src/main/java/vic/mod/integratedcircuits/gate/GateProvider.java b/src/main/java/vic/mod/integratedcircuits/gate/GateProvider.java index 4c2b231..652d220 100644 --- a/src/main/java/vic/mod/integratedcircuits/gate/GateProvider.java +++ b/src/main/java/vic/mod/integratedcircuits/gate/GateProvider.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import powercrystals.minefactoryreloaded.api.rednet.IRedNetNetworkContainer; import vic.mod.integratedcircuits.IntegratedCircuits; import vic.mod.integratedcircuits.tile.TileEntityGate; @@ -19,6 +20,11 @@ import codechicken.multipart.RedstoneInteractions; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; + +import com.bluepowermod.api.BPApi; +import com.bluepowermod.api.wire.redstone.IBundledDevice; +import com.bluepowermod.api.wire.redstone.IRedstoneApi; + import cpw.mods.fml.common.Optional.Method; import dan200.computercraft.api.ComputerCraftAPI; @@ -101,6 +107,7 @@ public static byte[] calculateBundledInput(IGateProvider provider, int side) input = calculateBundledInputNative(provider, side, pos, abs); if(input == null && IntegratedCircuits.isPRLoaded) input = calculateBundledInputProjectRed(provider, side); + if(input == null && IntegratedCircuits.isBPLoaded) input = calculateBundledInputBluePower(provider, side, pos, abs); if(!provider.isMultipart()) { @@ -120,6 +127,15 @@ private static byte[] calculateBundledInputNative(IGateProvider provider, int si return null; } + @Method(modid = "bluepower") + private static byte[] calculateBundledInputBluePower(IGateProvider provider, int side, BlockCoord pos, int abs) + { + IRedstoneApi redstoneAPI = BPApi.getInstance().getRedstoneApi(); + IBundledDevice device = redstoneAPI.getBundledDevice(provider.getWorld(), pos.x, pos.y, pos.z, ForgeDirection.getOrientation(provider.getGate().getSide()), ForgeDirection.UNKNOWN); + if(device != null) return device.getBundledOutput(ForgeDirection.getOrientation(abs ^ 1)); + return null; + } + private static byte[] calculateBundledInputComputercraft(IGateProvider provider, int side, BlockCoord pos, int abs) { int input = ComputerCraftAPI.getBundledRedstoneOutput(provider.getWorld(), pos.x, pos.y, pos.z, abs ^ 1);