diff --git a/CHANGELOG.md b/CHANGELOG.md index c10db35b..fe147fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,3 @@ -Hi! Version 0.2.5.4 +Hi! Version 0.2.5.5 -- Fixed scaling for macro's screens, now you can use it with any ui scale -- Fixed but with key handler in macro edit screen (before you can't press backspace, now you can) -- Cleanups "under the hood" deleted useless "dead" code -- Removed useless argument "test" from /redstone-helper -- Removed useless argument "cleanup" from /redstone-helper -- Now if redstone helper created a config file the first time, it didn't cause errors in logs \ No newline at end of file + - Fixed [#141](https://github.com/Bumer-32/Redstone-Helper/issues/141), now autowire will not overwrite blocks, also no autowire works with airplace (Thanks [ibotimew](https://github.com/ibotimew)) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 691a1233..70a8d835 100644 --- a/build.gradle +++ b/build.gradle @@ -2,9 +2,9 @@ import com.modrinth.minotaur.dependencies.ModDependency import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - id "fabric-loom" version "1.10.4" - id "org.jetbrains.kotlin.plugin.serialization" version "2.1.10" - id "org.jetbrains.kotlin.jvm" version "2.1.10" + id "fabric-loom" version "1.11.4" + id "org.jetbrains.kotlin.plugin.serialization" version "2.2.0" + id "org.jetbrains.kotlin.jvm" version "2.2.0" id "com.modrinth.minotaur" version "2.+" id "maven-publish" } diff --git a/gradle.properties b/gradle.properties index d1a45885..1c148302 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,12 +7,12 @@ kotlin.daemon.jvmargs=-Xmx2G # check these on https://fabricmc.net/develop minecraft_version=1.21.4 yarn_mappings=1.21.4+build.8 -loader_version=0.16.10 -fabric_kotlin_version=1.13.0+kotlin.2.1.0 -fabric_api_version=0.115.0+1.21.4 +loader_version=0.16.14 +fabric_kotlin_version=1.13.4+kotlin.2.2.0 +fabric_api_version=0.119.3+1.21.4 # Mod Properties -mod_version=0.2.5.4 +mod_version=0.2.5.5 maven_group=ua.pp.lumivoid.redstonehelper archives_base_name=redstone-helper @@ -21,7 +21,7 @@ archives_base_name=redstone-helper # -Fix - for small fixes and problems with launch version_suffix= -release_minecraft_versions=["1.21.3", "1.21.4"] +release_minecraft_versions=["1.21.4"] # Dependencies # https://mathparser.org/ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e18bc253..d4081da4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/commands/ColorcodeCommand.kt b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/commands/ColorcodeCommand.kt index 52bcf3d8..2a1fa1e9 100644 --- a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/commands/ColorcodeCommand.kt +++ b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/commands/ColorcodeCommand.kt @@ -67,7 +67,7 @@ object ColorcodeCommand { "${StringArgumentType.getString(context, "color")}_${it}" ) if (Registries.BLOCK.containsId(fullId)) { - SendPacket.sendPacket(SetBlockC2SPacket(blockPos, fullId, Direction.UP, Constants.aMinecraftClass)) + SendPacket.sendPacket(SetBlockC2SPacket(blockPos, fullId, Direction.UP, false, Constants.aMinecraftClass)) totalBlocksColored++ } return@any true diff --git a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/keybindings/minecraft/UseKeyBinding.kt b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/keybindings/minecraft/UseKeyBinding.kt index d9d7e565..a7d6ba65 100644 --- a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/keybindings/minecraft/UseKeyBinding.kt +++ b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/keybindings/minecraft/UseKeyBinding.kt @@ -26,6 +26,11 @@ object UseKeyBinding { client.player!!.swingHand(client.player!!.activeHand) client.networkHandler!!.sendPacket(PlayerInteractBlockC2SPacket(client.player!!.activeHand, hit, 1)) lastBlockPlacementTime = currentTime + + // Autowire + if (ClientOptions.isAutoWireEnabled) { + ClientOptions.autoWireMode.place(hit.blockPos, client.player!!, client.player!!.world) + } } } } diff --git a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/packets/c2s/SetBlockC2SPacket.kt b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/packets/c2s/SetBlockC2SPacket.kt index e8751430..10b0764f 100644 --- a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/packets/c2s/SetBlockC2SPacket.kt +++ b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/packets/c2s/SetBlockC2SPacket.kt @@ -5,4 +5,4 @@ import net.minecraft.util.math.BlockPos import net.minecraft.util.math.Direction @JvmRecord -data class SetBlockC2SPacket(val blockPos: BlockPos, val block: Identifier, val direction: Direction, val aMinecraftClass: Identifier) +data class SetBlockC2SPacket(val blockPos: BlockPos, val block: Identifier, val direction: Direction, val isAuto: Boolean, val aMinecraftClass: Identifier) diff --git a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/receiver/server/SetBlockPacketReceiver.kt b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/receiver/server/SetBlockPacketReceiver.kt index 536d0dff..52211bdb 100644 --- a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/receiver/server/SetBlockPacketReceiver.kt +++ b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/network/receiver/server/SetBlockPacketReceiver.kt @@ -17,6 +17,7 @@ object SetBlockPacketReceiver { Constants.NET_CHANNEL.registerServerbound(SetBlockC2SPacket::class.java) { message, access -> Scheduling.scheduleAction(1) { // delay, need to place dust because it thinks there's no block under it + if (message.isAuto && !access.player.serverWorld.getBlockState(message.blockPos).isAir) return@scheduleAction var blockState = Registries.BLOCK.get(message.block).defaultState if (message.direction != Direction.UP) { @@ -33,7 +34,6 @@ object SetBlockPacketReceiver { access.player.serverWorld.setBlockState(message.blockPos, blockState) access.player.serverWorld.updateNeighbors(message.blockPos.east(), blockState.block) } - } } } \ No newline at end of file diff --git a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/util/features/AutoWire.kt b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/util/features/AutoWire.kt index 8447e08b..8969b416 100644 --- a/src/main/kotlin/ua/pp/lumivoid/redstonehelper/util/features/AutoWire.kt +++ b/src/main/kotlin/ua/pp/lumivoid/redstonehelper/util/features/AutoWire.kt @@ -145,7 +145,7 @@ enum class AutoWire { logger.debug("Trying to set $block block at $blockPos") val blockToSet = Identifier.of(block) - SendPacket.sendPacket(SetBlockC2SPacket(blockPos.up(), blockToSet, direction, Constants.aMinecraftClass)) + SendPacket.sendPacket(SetBlockC2SPacket(blockPos.up(), blockToSet, direction, true, Constants.aMinecraftClass)) } abstract fun place(blockPos: BlockPos, player: PlayerEntity, world: World): String