Skip to content

Commit

Permalink
Use data version provided by MC (#2955)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell authored Oct 21, 2024
1 parent a58910d commit 3806a82
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.item.ItemType;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
Expand Down Expand Up @@ -124,7 +125,6 @@
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.generator.ChunkGenerator;
Expand Down Expand Up @@ -194,7 +194,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
// A simple test
CraftServer.class.cast(Bukkit.getServer());

int dataVersion = CraftMagicNumbers.INSTANCE.getDataVersion();
int dataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != 3953 && dataVersion != 3955) {
throw new UnsupportedClassVersionError("Not 1.21(.1)!");
}
Expand All @@ -213,7 +213,7 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
);
chunkProviderExecutorField.setAccessible(true);

this.dataFixer = new PaperweightDataConverters(CraftMagicNumbers.INSTANCE.getDataVersion(), this);
this.dataFixer = new PaperweightDataConverters(dataVersion, this);

Watchdog watchdog;
try {
Expand Down

0 comments on commit 3806a82

Please sign in to comment.