diff --git a/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackListener.kt b/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackListener.kt index 5614f67..dd41b32 100644 --- a/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackListener.kt +++ b/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackListener.kt @@ -13,9 +13,9 @@ import java.net.URI * @param plugin The plugin class. This must implement the ResourcePackPlugin interface. * @param resourcePackServer The HTTP server manager associated with this plugin. */ -class ResourcePackListener(plugin: ResourcePackPlugin, resourcePackServer: ResourcePackServer) : Listener { +class ResourcePackListener(resourcePackServer: ResourcePackServer) : Listener { private val resourcePackInfo = ResourcePackInfo.resourcePackInfo() - .hash(plugin.resourcePackManager.resourcePackZipFile!!.sha1()) + .hash(resourcePackServer.resourcePackManager.resourcePackZipFile!!.sha1()) .uri(URI.create("http://" + resourcePackServer.socketAddress + "/")).build() @EventHandler diff --git a/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackServer.kt b/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackServer.kt index 14c8428..bdb4985 100644 --- a/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackServer.kt +++ b/lib/src/main/kotlin/foundation/esoteric/minecraft/plugins/library/pack/resource/ResourcePackServer.kt @@ -14,7 +14,7 @@ import java.net.InetSocketAddress * * @param plugin The plugin that implements this resource pack. */ -class ResourcePackServer(resourcePackManager: ResourcePackManager) { +class ResourcePackServer(val resourcePackManager: ResourcePackManager) { private val plugin = resourcePackManager.plugin @@ -49,7 +49,7 @@ class ResourcePackServer(resourcePackManager: ResourcePackManager) { server!!.executor = null server!!.start() - Bukkit.getPluginManager().registerEvents(ResourcePackListener(plugin, this), plugin) + Bukkit.getPluginManager().registerEvents(ResourcePackListener(this), plugin) } internal inner class ResourcePackDownloadHandler : HttpHandler {