From 8b3948af3fdc2e3ade97d32ceace7dec7e3f90be Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Wed, 9 Nov 2022 14:05:35 -0500 Subject: [PATCH] Fix crash --- build.gradle.kts | 17 +++++++++++++++++ src/FoosPlugin.kt | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6dfe5c4..6f8a943 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,4 +29,21 @@ tasks.jar { include("plugin.hjson") } duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} + +tasks.create("buildMove") { + dependsOn("jar") + doLast { + copy { + from("build/libs/mindustry-plugin.jar") + into("${System.getenv("destination")}/config/mods") + } + + exec { + workingDir = File(System.getenv("destination")) + commandLine("java", "-jar", System.getenv("jarpath"), "host") + standardOutput = System.out + standardInput = System.`in` + } + } } \ No newline at end of file diff --git a/src/FoosPlugin.kt b/src/FoosPlugin.kt index e2fac2d..fe320ae 100644 --- a/src/FoosPlugin.kt +++ b/src/FoosPlugin.kt @@ -7,6 +7,7 @@ import mindustry.gen.* import mindustry.mod.* import mindustry.net.* import mindustry.net.Administration.* +import java.io.* @Suppress("unused") class FoosPlugin : Plugin() { @@ -17,7 +18,7 @@ class FoosPlugin : Plugin() { /** Called after command creation */ override fun init() { - Log.info("[accent]Initialized Foo's Plugin v$version") + Log.info("Initialized Foo's Plugin v$version") /** @since v1 Plugin presence check */ Vars.netServer.addPacketHandler("fooCheck") { player, _ -> @@ -47,7 +48,7 @@ class FoosPlugin : Plugin() { /** @since v2 Informs clients of the transmission forwarding state. When [player] is null, the status is sent to everyone */ private fun enableTransmissions(player: Player? = null) { - val enabled = transmissions.string() + val enabled = transmissions.bool().toString() if (player != null) Call.clientPacketReliable(player.con, "fooTransmissionEnabled", enabled) else Call.clientPacketReliable("fooTransmissionEnabled", enabled) }