Skip to content

Commit

Permalink
Fix loading of configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
Aquerr committed Aug 8, 2024
1 parent 2b55f79 commit 423d22b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
compileJava.options.encoding = 'UTF-8'

group = 'io.github.aquerr.chestrefill'
version = '1.12.2-1.6.3'
version = '1.12.2-1.6.4'
description = 'Plugin for restoring contents of a container after the specified time.'

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void onGameInitialization(GameInitializationEvent event)
chestRefill = this;
try
{
this.configuration = new ConfigurationImpl(getConfigDir());
this.configuration = new ConfigurationImpl(this, getConfigDir());
}
catch (Exception exception)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/aquerr/chestrefill/PluginInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class PluginInfo
{
public static final String ID = "chestrefill";
public static final String NAME = "Chest Refill";
public static final String VERSION = "1.6.3";
public static final String VERSION = "1.6.4";
public static final String DESCRIPTION = "Plugin for restoring contents of a container after the specified time.";
public static final String URL = "https://github.com/Aquerr/ChestRefill";
public static final Text PLUGIN_PREFIX = Text.of(TextColors.GOLD, "[CR] ");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.aquerr.chestrefill.config;

import io.github.aquerr.chestrefill.ChestRefill;
import ninja.leaping.configurate.ConfigurationOptions;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
Expand All @@ -25,13 +26,13 @@ public class ConfigurationImpl implements Configuration
//Configs
private Map<Class<? extends AbstractConfig>, AbstractConfig> configs = new HashMap<>();

public ConfigurationImpl(Path configDir) throws IOException
public ConfigurationImpl(ChestRefill plugin, Path configDir) throws IOException
{
this.configDirectoryPath = configDir;
Files.createDirectories(this.configDirectoryPath);

this.configPath = this.configDirectoryPath.resolve(CONFIG_FILE_NAME);
Asset asset = Sponge.getAssetManager().getAsset(this, "config.conf").orElse(null);
Asset asset = Sponge.getAssetManager().getAsset(plugin, "config.conf").orElse(null);

try
{
Expand Down

0 comments on commit 423d22b

Please sign in to comment.