Skip to content

Commit

Permalink
Merge pull request #33 from SourceWriters/development
Browse files Browse the repository at this point in the history
Fix DataProvider crashing plugins on Startup
  • Loading branch information
Lauriichan authored Jan 23, 2022
2 parents e8a5580 + cce3ebb commit f283707
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 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
4 changes: 2 additions & 2 deletions 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 All @@ -19,7 +19,7 @@
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-api</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions 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 All @@ -27,7 +27,7 @@
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-api</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>

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
10 changes: 5 additions & 5 deletions 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 All @@ -14,25 +14,25 @@
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-api</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
</dependency>

<!-- vCompat Versions -->

<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-legacy</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-1_17_R1</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-1_18_R1</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions 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 All @@ -15,7 +15,7 @@
<dependency>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-api</artifactId>
<version>3.0.0</version>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>

Expand Down

0 comments on commit f283707

Please sign in to comment.