Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ void enable() {
Settings.reload();
Lang.reload();

// Save the default display attribute configuration if it does not exist.
saveDefaultAttributeDefaults();

PluginManager pluginManager = Bukkit.getPluginManager();
this.integrationAvailabilityService = new IntegrationAvailabilityService(plugin, pluginManager);
this.integrationAvailabilityService.initialize();
Expand All @@ -94,7 +97,6 @@ void enable() {

setupMetrics();
checkForUpdates();

BungeeUtils.init();
}

Expand Down Expand Up @@ -125,6 +127,8 @@ public void reload() {
Settings.reload();
Lang.reload();

// Save the default display attribute configuration if it was deleted or is missing.
saveDefaultAttributeDefaults();
this.animationManager.reload();
this.hologramManager.reload();
this.featureManager.reload();
Expand All @@ -135,6 +139,27 @@ public void reload() {
EventFactory.fireReloadEvent();
}

/**
* Saves attribute-defaults.yml from the plugin jar to the plugin data folder
* if the file does not already exist.
* This prevents the warning:
* "No attribute defaults file found. Skipping."
*/
private void saveDefaultAttributeDefaults() {
File file = new File(plugin.getDataFolder(), "attribute-defaults.yml");

if (file.exists()) {
return;
}

try {
plugin.saveResource("attribute-defaults.yml", false);
Log.info("Saved default attribute-defaults.yml.");
} catch (IllegalArgumentException e) {
Log.warn("Could not save attribute-defaults.yml because it was not found inside the plugin jar.");
}
}

private void initializeNmsAdapter() {
try {
nmsAdapter = new NmsAdapterFactory().createNmsAdapter(Version.CURRENT);
Expand Down Expand Up @@ -185,5 +210,4 @@ public File getDataFolder() {
public Logger getLogger() {
return plugin.getLogger();
}

}
}