Skip to content

Commit eb433ea

Browse files
committed
HOTFIX: revert commit for 635cbf1 512e7c5
1 parent 6024df4 commit eb433ea

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

InventoryGUI-api/src/main/kotlin/net/projecttl/inventory/InventoryGUI.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ object InventoryGUI {
2525
* The service plugin. Defaults to the plugin that loaded this library. You can modify this later if you want to.
2626
*
2727
* @throws InvalidPluginException if the current library isn't loaded by a plugin
28-
* @throws IllegalArgumentException if not loaded by `io.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader.class`
29-
* @throws IllegalStateException if the plugin is not found from the classloader
3028
*/
3129
var plugin: Plugin = Downstream.pullPlugin()
3230
private set
33-
}
31+
}
3432

3533
/**
3634
* Opens the default GUI for a player.

InventoryGUI-api/src/main/kotlin/net/projecttl/inventory/util/Downstream.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package net.projecttl.inventory.util
22

3-
import net.projecttl.inventory.InventoryGUI
43
import org.bukkit.Bukkit
54
import org.bukkit.plugin.InvalidPluginException
65
import org.bukkit.plugin.Plugin
7-
import org.bukkit.plugin.java.JavaPlugin
86
import org.bukkit.plugin.java.PluginClassLoader
97

108
// from https://github.com/monun/heartbeat-coroutines/blob/master/heartbeat-coroutines/src/main/kotlin/io/github/monun/heartbeat/coroutines/Downstream.kt
@@ -21,16 +19,6 @@ internal object Downstream {
2119
get() = classLoaderFields.map { it.get(this) }.filterIsInstance<ClassLoader>()
2220

2321
fun pullPlugin(): Plugin {
24-
try{
25-
val getProvidingPlugin = JavaPlugin::class.java.getDeclaredMethod("getProvidingPlugin", Class::class.java)
26-
27-
return getProvidingPlugin.invoke(null, InventoryGUI) as Plugin
28-
}catch (_: NoSuchMethodException){}
29-
30-
return pullPluginBukkit()
31-
}
32-
33-
private fun pullPluginBukkit(): Plugin {
3422
val classLoader = Downstream::class.java.classLoader
3523

3624
return Bukkit.getPluginManager().plugins.find { plugin ->

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "net.projecttl"
11-
version = "4.6.2"
11+
version = "4.6.3"
1212

1313
allprojects {
1414
apply(plugin = "com.gradleup.shadow")

0 commit comments

Comments
 (0)