EcoCityCraft/Spigot — pull request #12 by SuperSpyTX (2012-11-03 01:13:54+00:00)
Title: MinecraftServer.getPlugins() cache - Possible fix for #7

@md-5 asked me if I could do a PR.

I got bored.

So I made this quick cache system. Basically what it does, it simply checks whether the # of plugins have changed (calling getPluginManager().getPlugins().length, wasn't sure how else I could implement it in a different way) if not, it then returns a cached reply.

The first time it's called, the "cache is built" by making the reply first, then it's stored into a variable. It also stores the current # of plugins at the time of the first call.

This is a possible fix for issue #7.