Skip to content

Commit 1d951d2

Browse files
authored
[Bukkit] Fix regen on 26.1+ (#2946)
1 parent 68e2d01 commit 1d951d2

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

worldedit-bukkit/adapters/adapter-26.1/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ plugins {
66

77
dependencies {
88
// https://artifactory.papermc.io/ui/native/universe/io/papermc/paper/dev-bundle/
9-
the<PaperweightUserDependenciesExtension>().paperDevBundle("26.1.1.build.14-alpha")
9+
the<PaperweightUserDependenciesExtension>().paperDevBundle("26.1.1.build.29-alpha")
1010
}

worldedit-bukkit/adapters/adapter-26.1/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/v26_1/PaperweightAdapter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
import net.minecraft.world.level.levelgen.structure.Structure;
140140
import net.minecraft.world.level.levelgen.structure.StructureStart;
141141
import net.minecraft.world.level.storage.LevelStorageSource;
142+
import net.minecraft.world.level.storage.SavedDataStorage;
142143
import net.minecraft.world.level.storage.TagValueInput;
143144
import net.minecraft.world.level.storage.TagValueOutput;
144145
import net.minecraft.world.phys.BlockHitResult;
@@ -234,7 +235,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
234235
var unused = CraftServer.class.cast(Bukkit.getServer());
235236

236237
int dataVersion = SharedConstants.getCurrentVersion().dataVersion().version();
237-
if (dataVersion != Constants.DATA_VERSION_MC_26_1 && dataVersion != Constants.DATA_VERSION_MC_26_1_1) {
238+
if (dataVersion < Constants.DATA_VERSION_MC_26_1 || dataVersion > Constants.DATA_VERSION_MC_26_1_2) {
238239
logger.warning(WRONG_VERSION);
239240
}
240241

@@ -793,7 +794,7 @@ private void doRegen(World bukkitWorld, Region region, Extent extent, RegenOptio
793794
env,
794795
gen,
795796
bukkitWorld.getBiomeProvider(),
796-
originalWorld.getDataStorage(),
797+
new SavedDataStorage(session.getDimensionPath(originalWorld.dimension()), originalWorld.getServer().getFixerUpper(), originalWorld.registryAccess()),
797798
loadedWorldData
798799
);
799800
try {

worldedit-core/src/main/java/com/sk89q/worldedit/internal/Constants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,9 @@ private Constants() {
144144
* The DataVersion for Minecraft 26.1.1.
145145
*/
146146
public static final int DATA_VERSION_MC_26_1_1 = 4788;
147+
148+
/**
149+
* The DataVersion for Minecraft 26.1.2.
150+
*/
151+
public static final int DATA_VERSION_MC_26_1_2 = 4790;
147152
}

0 commit comments

Comments
 (0)