Package nl.pim16aap2.animatedarchitecture.spigot.core
The AnimatedArchitecturePlugin class is the main
JavaPlugin class that is instantiated on server startup. This class creates and
manages the AnimatedArchitectureSpigotPlatform.
Interaction with this plugin mostly happens through the
IAnimatedArchitecturePlatform. This can be obtained as follows:
private IAnimatedArchitecturePlatform getAnimatedArchitecturePlatform(JavaPlugin accessor)
{
final @Nullable AnimatedArchitecturePlugin animatedArchitecturePlugin =
(AnimatedArchitecturePlugin) Bukkit.getPluginManager().getPlugin("AnimatedArchitecture");
if (animatedArchitecturePlugin == null)
// Handle this issue.
return animatedArchitecturePlugin.getAnimatedArchitectureSpigotPlatform(accessor).orElseThrow();
}
The 'accessor' parameter here is a reference to the plugin that is requesting access to the platform. This is used for debugging purposes, as it allows AnimatedArchitecture to see which plugins have accessed the platform.
The platform will not be available before this plugin has been enabled or if some issue occurred while attempting to enable it. How to deal with the AnimatedArchitecturePlugin being null or the platform not existing is up to the plugin requesting access.
A useful class for plugins that want to interact with the AnimatedArchitecture API is the
SpigotAdapter. This class contains some static utility methods
to wrap and unwrap Spigot objects to AnimatedArchitecture objects and vice versa.
-
ClassesClassDescriptionRepresents the base
JavaPluginfor AnimatedArchitecture.The main class of the Animated Architecture Spigot plugin.Module that provides the sub-platform for the Spigot platform based on the server version.