Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Nov 9, 2022
1 parent 4e5c3d3 commit 8b3948a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
}
}
5 changes: 3 additions & 2 deletions src/FoosPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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, _ ->
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 8b3948a

Please sign in to comment.