mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-10-02 06:44:39 +00:00
Initialise provider and file during first reload
This commit is contained in:
parent
3705dbdd2b
commit
718d9d9d3a
|
@ -24,14 +24,21 @@ import static com.earth2me.essentials.I18n.tl;
|
|||
public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
||||
protected static final Logger LOGGER = Logger.getLogger("Essentials");
|
||||
private final transient IEssentials ess;
|
||||
private final transient ItemDbProvider provider;
|
||||
private transient ItemDbProvider provider = null;
|
||||
|
||||
private final transient ManagedFile file;
|
||||
private transient ManagedFile file = null;
|
||||
|
||||
public ItemDb(final IEssentials ess) {
|
||||
this.ess = ess;
|
||||
this.provider = ess.getItemDbProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
if (provider == null) {
|
||||
this.provider = ess.getItemDbProvider();
|
||||
}
|
||||
|
||||
if (file == null) {
|
||||
if (provider instanceof LegacyItemDbProvider) {
|
||||
file = new ManagedFile("items.csv", ess);
|
||||
} else {
|
||||
|
@ -39,8 +46,6 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
provider.rebuild(file.getLines());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue