From f6939f32670179f583d0bc006632a39b4116c684 Mon Sep 17 00:00:00 2001 From: Lauriichan Date: Sun, 23 Jan 2022 09:44:47 +0100 Subject: [PATCH 1/2] Fix DataProvider on Startup --- pom.xml | 2 +- vcompat-1_17_R1/pom.xml | 2 +- vcompat-1_18_R1/pom.xml | 2 +- vcompat-api/pom.xml | 2 +- .../minecraft/vcompat/provider/DataProvider.java | 8 +++++--- vcompat-core/pom.xml | 2 +- vcompat-legacy/pom.xml | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 6b2282f..575ac05 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 pom diff --git a/vcompat-1_17_R1/pom.xml b/vcompat-1_17_R1/pom.xml index 3ff304f..3791537 100644 --- a/vcompat-1_17_R1/pom.xml +++ b/vcompat-1_17_R1/pom.xml @@ -5,7 +5,7 @@ net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 vcompat-1_17_R1 diff --git a/vcompat-1_18_R1/pom.xml b/vcompat-1_18_R1/pom.xml index 6c0e105..4a600c7 100644 --- a/vcompat-1_18_R1/pom.xml +++ b/vcompat-1_18_R1/pom.xml @@ -5,7 +5,7 @@ net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 vcompat-1_18_R1 diff --git a/vcompat-api/pom.xml b/vcompat-api/pom.xml index 3a9bd4a..5a7724d 100644 --- a/vcompat-api/pom.xml +++ b/vcompat-api/pom.xml @@ -3,7 +3,7 @@ net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 vcompat-api diff --git a/vcompat-api/src/main/java/net/sourcewriters/minecraft/vcompat/provider/DataProvider.java b/vcompat-api/src/main/java/net/sourcewriters/minecraft/vcompat/provider/DataProvider.java index d7c7943..d40a58a 100644 --- a/vcompat-api/src/main/java/net/sourcewriters/minecraft/vcompat/provider/DataProvider.java +++ b/vcompat-api/src/main/java/net/sourcewriters/minecraft/vcompat/provider/DataProvider.java @@ -19,8 +19,7 @@ public class DataProvider extends VersionHandler { public static final Supplier DEFAULT_RANDOM = UUID::randomUUID; protected final NbtAdapterRegistry registry = new NbtAdapterRegistry(); - protected final DataDistributor defaultDistributor = createDistributor( - new File(Bukkit.getWorlds().get(0).getWorldFolder(), "pluginData")); + private DataDistributor defaultDistributor; protected DataProvider(VersionControl versionControl) { super(versionControl); @@ -35,10 +34,13 @@ public WrappedContainer createContainer() { } public WrappedContainer createPersistentContainer() { - return new SimpleSyntaxContainer<>(defaultDistributor.create()); + return new SimpleSyntaxContainer<>(getDefaultDistributor().create()); } public DataDistributor getDefaultDistributor() { + if (defaultDistributor == null) { + return defaultDistributor = createDistributor(new File(Bukkit.getWorlds().get(0).getWorldFolder(), "pluginData")); + } return defaultDistributor; } diff --git a/vcompat-core/pom.xml b/vcompat-core/pom.xml index 4d3a05a..29f7edd 100644 --- a/vcompat-core/pom.xml +++ b/vcompat-core/pom.xml @@ -3,7 +3,7 @@ net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 vcompat diff --git a/vcompat-legacy/pom.xml b/vcompat-legacy/pom.xml index 654cf49..ab8da2b 100644 --- a/vcompat-legacy/pom.xml +++ b/vcompat-legacy/pom.xml @@ -3,7 +3,7 @@ net.sourcewriters.minecraft vcompat-parent - 3.0.0 + 3.0.1 vcompat-legacy From cce3ebb673a318e264861e59bdf7f99d930c560e Mon Sep 17 00:00:00 2001 From: Lauriichan Date: Sun, 23 Jan 2022 09:47:46 +0100 Subject: [PATCH 2/2] Update pom dependencies to use parent version --- vcompat-1_17_R1/pom.xml | 2 +- vcompat-1_18_R1/pom.xml | 2 +- vcompat-core/pom.xml | 8 ++++---- vcompat-legacy/pom.xml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vcompat-1_17_R1/pom.xml b/vcompat-1_17_R1/pom.xml index 3791537..2c79d40 100644 --- a/vcompat-1_17_R1/pom.xml +++ b/vcompat-1_17_R1/pom.xml @@ -19,7 +19,7 @@ net.sourcewriters.minecraft vcompat-api - 3.0.0 + ${project.parent.version} provided diff --git a/vcompat-1_18_R1/pom.xml b/vcompat-1_18_R1/pom.xml index 4a600c7..df7dc73 100644 --- a/vcompat-1_18_R1/pom.xml +++ b/vcompat-1_18_R1/pom.xml @@ -27,7 +27,7 @@ net.sourcewriters.minecraft vcompat-api - 3.0.0 + ${project.parent.version} provided diff --git a/vcompat-core/pom.xml b/vcompat-core/pom.xml index 29f7edd..ac88914 100644 --- a/vcompat-core/pom.xml +++ b/vcompat-core/pom.xml @@ -14,7 +14,7 @@ net.sourcewriters.minecraft vcompat-api - 3.0.0 + ${project.parent.version} @@ -22,17 +22,17 @@ net.sourcewriters.minecraft vcompat-legacy - 3.0.0 + ${project.parent.version} net.sourcewriters.minecraft vcompat-1_17_R1 - 3.0.0 + ${project.parent.version} net.sourcewriters.minecraft vcompat-1_18_R1 - 3.0.0 + ${project.parent.version} diff --git a/vcompat-legacy/pom.xml b/vcompat-legacy/pom.xml index ab8da2b..454dc64 100644 --- a/vcompat-legacy/pom.xml +++ b/vcompat-legacy/pom.xml @@ -15,7 +15,7 @@ net.sourcewriters.minecraft vcompat-api - 3.0.0 + ${project.parent.version} provided