2024-11-03 14:25:00 -06:00
23 changed files with 69 additions and 38 deletions

View File

@ -12,6 +12,6 @@ repositories {
dependencies {
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.21.1-R0.1-SNAPSHOT/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.1-R0.1-20241012.212042-119")
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.1-R0.1-20241021.162528-124")
compileOnly(libs.paperlib)
}

View File

@ -65,6 +65,7 @@ import com.sk89q.worldedit.world.block.BlockType;
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;
@ -124,7 +125,6 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
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;
@ -194,7 +194,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
// 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)!");
}
@ -213,7 +213,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
);
chunkProviderExecutorField.setAccessible(true);
this.dataFixer = new PaperweightDataConverters(CraftMagicNumbers.INSTANCE.getDataVersion(), this);
this.dataFixer = new PaperweightDataConverters(dataVersion, this);
Watchdog watchdog;
try {

View File

@ -155,7 +155,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
* Utilises ConcurrentHashMap#compute for easy synchronisation for all of the above. Only tryWriteLock is used in blocks
* synchronised using ConcurrentHashMap methods.
*
* @since TODO
* @since 2.12.0
*/
protected static <LevelChunkSection> boolean setSectionAtomic(
String worldName,
@ -212,7 +212,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
* <p>
* Utilises ConcurrentHashMap#compute for easy synchronisation
*
* @since TODO
* @since 2.12.0
*/
protected static void beginChunkPacketSend(String worldName, IntPair pair, StampLockHolder stampedLock) {
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName);
@ -233,7 +233,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
/**
* Releases the read lock acquired when sending a chunk packet for a chunk
*
* @since TODO
* @since 2.12.0
*/
protected static void endChunkPacketSend(String worldName, IntPair pair, StampLockHolder lockHolder) {
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName);