diff --git a/dependencies.gradle b/dependencies.gradle index 678b688..689898e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,6 +3,7 @@ dependencies { api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-527-GTNH:dev') api('com.github.GTNewHorizons:bdlib:1.10.0-GTNH:dev') + api('com.github.GTNewHorizons:GTNHLib:0.6.5:dev') implementation('com.github.GTNewHorizons:waila:1.8.2:dev') {transitive=false} compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.25-GTNH:dev') diff --git a/src/main/scala/net/bdew/ae2stuff/AE2Stuff.scala b/src/main/scala/net/bdew/ae2stuff/AE2Stuff.scala index a40f13e..ba31a82 100644 --- a/src/main/scala/net/bdew/ae2stuff/AE2Stuff.scala +++ b/src/main/scala/net/bdew/ae2stuff/AE2Stuff.scala @@ -9,8 +9,9 @@ package net.bdew.ae2stuff -import java.io.File +import com.gtnewhorizon.gtnhlib.keybind.SyncedKeybind +import java.io.File import cpw.mods.fml.common.Mod import cpw.mods.fml.common.Mod.EventHandler import cpw.mods.fml.common.event._ @@ -27,13 +28,14 @@ import net.bdew.ae2stuff.network.NetHandler import net.bdew.lib.Event import net.bdew.lib.gui.GuiHandler import org.apache.logging.log4j.Logger +import org.lwjgl.input.Keyboard @Mod( modid = AE2Stuff.modId, version = "GRADLETOKEN_VERSION", name = "AE2 Stuff", dependencies = - "required-after:appliedenergistics2;required-after:bdlib@[1.9.4.109,)", + "required-after:appliedenergistics2;required-after:bdlib@[1.9.4.109,);required-after:gtnhlib@[0.6.5,)", modLanguage = "scala" ) object AE2Stuff { @@ -46,6 +48,7 @@ object AE2Stuff { var configDir: File = null val guiHandler = new GuiHandler + val keybindLCtrl: SyncedKeybind = SyncedKeybind.create(Keyboard.KEY_LCONTROL) def logDebug(msg: String, args: Any*) = log.debug(msg.format(args: _*)) def logInfo(msg: String, args: Any*) = log.info(msg.format(args: _*)) diff --git a/src/main/scala/net/bdew/ae2stuff/items/AdvWirelessKit.scala b/src/main/scala/net/bdew/ae2stuff/items/AdvWirelessKit.scala index b7a23f0..82d7ecb 100644 --- a/src/main/scala/net/bdew/ae2stuff/items/AdvWirelessKit.scala +++ b/src/main/scala/net/bdew/ae2stuff/items/AdvWirelessKit.scala @@ -11,6 +11,7 @@ package net.bdew.ae2stuff.items import appeng.api.config.SecurityPermissions import appeng.api.exceptions.FailedConnection +import net.bdew.ae2stuff.AE2Stuff import net.bdew.ae2stuff.grid.Security import net.bdew.ae2stuff.machines.wireless.{BlockWireless, TileWireless} import net.bdew.ae2stuff.misc.AdvItemLocationStore @@ -20,7 +21,6 @@ import net.bdew.lib.items.SimpleItem import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemStack import net.minecraft.world.World -import org.lwjgl.input.Keyboard import java.util @@ -53,7 +53,7 @@ object AdvWirelessKit ): ItemStack = { import net.bdew.lib.helpers.ChatHelper._ if (!world.isRemote && player.isSneaking) { - if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (AE2Stuff.keybindLCtrl.isKeyDown(player)) { while (hasLocation(stack)) { popLocation(stack) } @@ -97,7 +97,7 @@ object AdvWirelessKit if (!pos.blockIs(world, BlockWireless)) return false if (!world.isRemote) { if (player.isSneaking) { - if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (AE2Stuff.keybindLCtrl.isKeyDown(player)) { while (hasLocation(stack)) { popLocation(stack) } @@ -149,7 +149,7 @@ object AdvWirelessKit return true } isHub = tempTE.isHub - if (isHub && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (isHub && AE2Stuff.keybindLCtrl.isKeyDown(player)) { val t = 32 - tempTE.connectionsList.length var i = 0 while (i < t) { @@ -184,7 +184,7 @@ object AdvWirelessKit while (doLoop) { doLoop = false if (hasLocation(stack)) { - if (tile.isHub && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (tile.isHub && AE2Stuff.keybindLCtrl.isKeyDown(player)) { if ( tile.connectionsList.length < 31 && getLocations(stack) .tagCount() > 1