API
The API is only available for Homestead 3.0.0 and higher.
Example plugin
import java.util.logging.Logger;
import org.bukkit.plugin.java.JavaPlugin;
import tfagaming.projects.minecraft.homestead.Homestead;
import tfagaming.projects.minecraft.homestead.api.API;
import tfagaming.projects.minecraft.homestead.api.HomesteadAPI;
public class Plugin extends JavaPlugin {
private static final Logger logger = Logger.getLogger("Example");
public void onEnable() {
logger.info("Example plugin is enabled");
try {
// Get the instance (verifies if the plugin is installed and enabled)
Homestead instance = Homestead.getInstance();
// Showing Homestead's installed version on the server
logger.info("Homestead's version = " + Homestead.getVersion());
// Getting the API
HomesteadAPI api = new API();
api.getRegionsManager();
api.getChunksManager();
} catch (NoClassDefFoundError e) {
logger.warning("Unable to find Homestead plugin!");
}
}
public void onDisable() {
logger.info("Example plugin is disabled");
}
}

Last updated