Skip to content

Commit

Permalink
fixed incorrect dependency resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Nov 27, 2022
1 parent d76dd80 commit 3cf8b93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
5 changes: 3 additions & 2 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val name = "AstraNPCS"
val pluginName = "AstraNPCS"
group = Dependencies.group
version = Dependencies.version
description = "AstraNPCS"
Expand Down Expand Up @@ -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
)
Expand All @@ -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()
Expand Down
28 changes: 12 additions & 16 deletions plugin/src/main/kotlin/com/astrainteractive/astranpcs/AstraNPCS.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PacketReader(private val npcManager: NPCManager) : AstraPacketReader<Packe
typeField.javaClass.declaredFields.getOrNull(1)?.let { getClassFieldValue(typeField, it.name) as? Vec3D }
?: return
if (enumHand != EnumHand.a) return

println("Clicked: $id; actualList: ${npcManager.registeredNPCs.map { it.entityID }}")
val npc = npcManager.registeredNPCs.firstOrNull { it.entityID == id } ?: return
PluginScope.launch(Dispatchers.BukkitMain) {
Bukkit.getPluginManager().callEvent(NPCInteractionEvent(player, npc))
Expand Down

0 comments on commit 3cf8b93

Please sign in to comment.