GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.9k stars 273 forks source link

Metrics fails #308

Closed Rocologo closed 8 years ago

Rocologo commented 8 years ago

Hi,

I'm trying to make my plugin MobHunting run with the Glowstone++ Server but Metrics fails in onEnable()

08:44:53 [INFO] [MobHunting] Enabling MobHunting v3.2.5-SNAPSHOT 08:44:53 [INFO] [MobHunting] Enabling compatibility with Essentials (2.0.1-b334) 08:44:53 [SEVERE] Error occurred while enabling MobHunting v3.2.5-SNAPSHOT (Is it up to date?) java.lang.NoSuchMethodError: org.mcstats.Metrics.(Lorg/bukkit/plugin/Plugin;)V at one.lindegaard.MobHunting.MetricsManager.startMetrics(MetricsManager.java:43) at one.lindegaard.MobHunting.MobHunting.onEnable(MobHunting.java:295) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:304) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:428) at net.glowstone.GlowServer.enablePlugins(GlowServer.java:831) at net.glowstone.GlowServer.start(GlowServer.java:529) at net.glowstone.GlowServer.run(GlowServer.java:454) at net.glowstone.GlowServer.main(GlowServer.java:311) 08:44:53 [INFO] [MobHunting] Disabling MobHunting v3.2.5-SNAPSHOT

I don't understand why it fails, it work on both Spigot, PaperClip, CraftBukkit. What do I need to do to make it run?

gdude2002 commented 8 years ago

This is because we bundle our own copy of MCStats. You should not need to activate it when you're loading on a Glowstone server.

By the way, metrics loading should not be a failing error in your plugin in the first place. If you do still want that, you should check whether the server is a Glowstone server.

kamcio96 commented 8 years ago

@gdude2002 we can move that package to net.glowstone

Rocologo commented 8 years ago

I agree, it should not break the plugin, but I dont know how to do it otherwise.

If you can tell me how to test if it is a Glowstone server I will add it to my onEnable() method?

kamcio96 commented 8 years ago
if (getServer().getName().toLowerCase().contains("glowstone")) {
   ...
}
Rocologo commented 8 years ago

Thank you. :-)

mastercoms commented 8 years ago

@kamcio96 moved in 8c0e32d2fb4b8670a7947adc53762940e257bf5d.