mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
Former-commit-id: 68eca3b8f4e61b40dab2ab03c0d2621050ae128e [formerly cce6bd6b8ca5be2314063f406adf60d66ac9f0ff] Former-commit-id: 94b0a5f71f01a4058de4d074c95b8178dd593c37
This commit is contained in:
1 parent
311dcda981
commit
e86a47df2e
1 file changed
+9
-8
@@ -27,6 +27,7 @@ public class Compatibility {
|
||||
*/
|
||||
public void toggleInteractListeners(boolean status) {
|
||||
if (status) {
|
||||
disabledListeners.clear();
|
||||
for (RegisteredListener listener : PlayerInteractEvent.getHandlerList().getRegisteredListeners()) {
|
||||
for (String pluginName : knownIncompatiablePlugin) {
|
||||
Plugin plugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
||||
@@ -34,20 +35,20 @@ public class Compatibility {
|
||||
if (listener.getPlugin() == plugin) {
|
||||
Util.debugLog("Disabled plugin " + pluginName + "'s listener " + listener.getListener().getClass()
|
||||
.getName());
|
||||
PlayerInteractEvent.getHandlerList().unregister(plugin);
|
||||
//PlayerInteractEvent.getHandlerList().unregister(plugin);
|
||||
PlayerInteractEvent.getHandlerList().unregister(listener);
|
||||
disabledListeners.add(listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String pluginString : knownIncompatiablePlugin) {
|
||||
Plugin plugin = Bukkit.getPluginManager().getPlugin(pluginString);
|
||||
if (plugin != null) {
|
||||
PlayerInteractEvent.getHandlerList().getRegisteredListeners();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PlayerInteractEvent.getHandlerList().registerAll(disabledListeners);
|
||||
try{
|
||||
PlayerInteractEvent.getHandlerList().registerAll(disabledListeners);
|
||||
disabledListeners.clear();
|
||||
}catch (Throwable e){
|
||||
//Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user