Skip to content

Commit

Permalink
Fix DataProvider on Startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauriichan committed Jan 23, 2022
1 parent 48644ee commit f6939f3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
<packaging>pom</packaging>

<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion vcompat-1_17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<artifactId>vcompat-1_17_R1</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion vcompat-1_18_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<artifactId>vcompat-1_18_R1</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion vcompat-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<artifactId>vcompat-api</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public class DataProvider extends VersionHandler<VersionControl> {
public static final Supplier<UUID> DEFAULT_RANDOM = UUID::randomUUID;

protected final NbtAdapterRegistry registry = new NbtAdapterRegistry();
protected final DataDistributor<UUID> defaultDistributor = createDistributor(
new File(Bukkit.getWorlds().get(0).getWorldFolder(), "pluginData"));
private DataDistributor<UUID> defaultDistributor;

protected DataProvider(VersionControl versionControl) {
super(versionControl);
Expand All @@ -35,10 +34,13 @@ public WrappedContainer createContainer() {
}

public WrappedContainer createPersistentContainer() {
return new SimpleSyntaxContainer<>(defaultDistributor.create());
return new SimpleSyntaxContainer<>(getDefaultDistributor().create());
}

public DataDistributor<UUID> getDefaultDistributor() {
if (defaultDistributor == null) {
return defaultDistributor = createDistributor(new File(Bukkit.getWorlds().get(0).getWorldFolder(), "pluginData"));
}
return defaultDistributor;
}

Expand Down
2 changes: 1 addition & 1 deletion vcompat-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<artifactId>vcompat</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion vcompat-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<artifactId>vcompat-legacy</artifactId>

Expand Down

0 comments on commit f6939f3

Please sign in to comment.