Skip to content

Commit

Permalink
Fix resource packs
Browse files Browse the repository at this point in the history
  • Loading branch information
EsotericEnderman committed Nov 3, 2024
1 parent f220073 commit 6957eca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6957eca

Please sign in to comment.