diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 146ab5b..99bbf28 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -1,4 +1,4 @@ -val name = "AstraNPCS" +val pluginName = "AstraNPCS" group = Dependencies.group version = Dependencies.version description = "AstraNPCS" @@ -97,7 +97,7 @@ tasks { from(sourceSets.main.get().resources.srcDirs) { filesMatching("plugin.yml") { expand( - "name" to project.name, + "name" to pluginName, "version" to project.version, "description" to project.description ) @@ -122,6 +122,7 @@ tasks.shadowJar { mergeServiceFiles() dependsOn(configurations) archiveClassifier.set(null as String?) + this.archiveBaseName.set(pluginName) from(sourceSets.main.get().output) from(project.configurations.runtimeClasspath) minimize() diff --git a/plugin/src/main/kotlin/com/astrainteractive/astranpcs/AstraNPCS.kt b/plugin/src/main/kotlin/com/astrainteractive/astranpcs/AstraNPCS.kt index 39f0f5b..09db1fc 100644 --- a/plugin/src/main/kotlin/com/astrainteractive/astranpcs/AstraNPCS.kt +++ b/plugin/src/main/kotlin/com/astrainteractive/astranpcs/AstraNPCS.kt @@ -29,8 +29,17 @@ class AstraNPCS : JavaPlugin() { Logger.prefix = "AstraNPCS" CommandManager() ClickNpcEvent() + Files.configFile.reload() + configModule.reload() + mojangApiModule.value + npcsModule.reload() + npcManagerModule.reload() + npcManagerModule.value.onEnable() + packetReaderModule.reload() + packetReaderModule.value.onEnable() + + - reload() } override fun onDisable() { @@ -43,20 +52,7 @@ class AstraNPCS : JavaPlugin() { } fun reload() { - Files.configFile.reload() - configModule.reload() - mojangApiModule.value - npcsModule.reload() - - npcManagerModule.value.onDisable() - npcManagerModule.reload() - npcManagerModule.value.onEnable() - - packetReaderModule.value.onDisable() - packetReaderModule.reload() - packetReaderModule.value.onEnable() - - runBlocking { AstraTaskTimer.cancelJobs() } - + onDisable() + onEnable() } } \ No newline at end of file diff --git a/versioned/core/src/main/kotlin/com/astrainteractive/astranpcs/utils/PacketReader.kt b/versioned/core/src/main/kotlin/com/astrainteractive/astranpcs/utils/PacketReader.kt index 96cd1c2..eaab67a 100644 --- a/versioned/core/src/main/kotlin/com/astrainteractive/astranpcs/utils/PacketReader.kt +++ b/versioned/core/src/main/kotlin/com/astrainteractive/astranpcs/utils/PacketReader.kt @@ -38,7 +38,7 @@ class PacketReader(private val npcManager: NPCManager) : AstraPacketReader