Skip to content

Instantly share code, notes, and snippets.

@tehbeard
Created October 28, 2012 00:35
Show Gist options
  • Select an option

  • Save tehbeard/3967030 to your computer and use it in GitHub Desktop.

Select an option

Save tehbeard/3967030 to your computer and use it in GitHub Desktop.
BuscriptPlugin.java.chunk
private File getStartupScript() {
File scriptFile = new File(getDataFolder(), "startup-script.txt");
if (!scriptFile.exists()) {
try {
this.saveResource("startup-script.txt", false);
if (!scriptFile.exists()) {
scriptFile.createNewFile();
}
} catch (IOException e) {
getLogger().severe("Error creating script file: " + e.getMessage());
getServer().getPluginManager().disablePlugin(this);
return null;
} catch (IllegalArgumentException e){
getLogger().info("Start up script not found in jar.");
}
}
return scriptFile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment