Skip to content

Commit

Permalink
Retarded typo
Browse files Browse the repository at this point in the history
Signed-off-by: DevDrizzy <[email protected]>
  • Loading branch information
DevDrizzy committed Jun 7, 2024
1 parent eb2ce22 commit 89491e7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/xyz/refinedev/api/storage/YamlStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
import org.bukkit.plugin.java.JavaPlugin;

import org.simpleyaml.configuration.ConfigurationSection;
import org.simpleyaml.configuration.comments.format.PrettyYamlCommentFormatter;
import org.simpleyaml.configuration.comments.format.YamlCommentFormat;
import org.simpleyaml.configuration.file.YamlConfiguration;
import org.simpleyaml.configuration.file.YamlConfigurationOptions;
import org.simpleyaml.configuration.file.YamlFile;
import org.simpleyaml.configuration.implementation.api.QuoteStyle;

import org.simpleyaml.configuration.implementation.snakeyaml.lib.comments.CommentType;
import xyz.refinedev.api.storage.annotations.ConfigValue;
import xyz.refinedev.api.storage.data.PluginData;

Expand Down Expand Up @@ -73,7 +71,7 @@ public YamlStorage(JavaPlugin plugin, String name, boolean saveResource) {
if (saveResource) {
this.config.load(file);
} else {
this.config.load();
this.config.loadWithComments();
}
} catch (IOException ex) {
LOGGER.error("[Storage] Could not load " + name + ".yml, please correct your syntax errors!");
Expand Down Expand Up @@ -113,7 +111,7 @@ public YamlStorage(JavaPlugin plugin, String name, String dataFolder) {
}

try {
this.config.load();
this.config.loadWithComments();
} catch (IOException ex) {
LOGGER.error("[Storage] Could not load " + name + ".yml, please correct your syntax errors!");
LOGGER.error("[Storage] Error: " + ex.getMessage());
Expand Down Expand Up @@ -158,7 +156,7 @@ public YamlStorage(PluginData data, String name, boolean saveResource) {
if (saveResource) {
this.config.load(file);
} else {
this.config.load();
this.config.loadWithComments();
}
} catch (IOException ex) {
LOGGER.error("[Storage] Could not load " + name + ".yml, please correct your syntax errors!");
Expand Down Expand Up @@ -236,7 +234,7 @@ public void writeConfig() {
*/
public void reloadConfig() {
try {
this.config.load();
this.config.loadWithComments();
} catch (IOException ex) {
LOGGER.error("[Storage] Could not load " + name + ".yml, please correct your syntax errors!");
LOGGER.error("[Storage] Error: " + ex.getMessage());
Expand Down Expand Up @@ -324,7 +322,7 @@ public int getInteger(String path) {

public int getInteger(String path, int or) {
int toReturn = this.getInteger(path);
return this.config.contains(path) ? or : toReturn;
return this.config.contains(path) ? toReturn : or;
}

public void set(String path, Object value) {
Expand Down

0 comments on commit 89491e7

Please sign in to comment.