From d13e56989ca39d3ae0a130331c933363fabaf7e0 Mon Sep 17 00:00:00 2001 From: MrPowerGamerBR Date: Tue, 17 Jun 2025 14:02:46 -0300 Subject: [PATCH] Fix build (I forgot to rebuild the patch, whoops) --- .../main/java/org/bukkit/Material.java.patch | 2 +- .../features/0001-Parallel-World-Ticking.patch | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sparklypaper-api/paper-patches/files/src/main/java/org/bukkit/Material.java.patch b/sparklypaper-api/paper-patches/files/src/main/java/org/bukkit/Material.java.patch index a863ad6..1f862e3 100644 --- a/sparklypaper-api/paper-patches/files/src/main/java/org/bukkit/Material.java.patch +++ b/sparklypaper-api/paper-patches/files/src/main/java/org/bukkit/Material.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -1697,6 +_,16 @@ +@@ -1717,6 +_,16 @@ ZOMBIE_HEAD(-1, Skull.class), ZOMBIE_WALL_HEAD(-1, WallSkull.class), // End generate - Blocks diff --git a/sparklypaper-server/minecraft-patches/features/0001-Parallel-World-Ticking.patch b/sparklypaper-server/minecraft-patches/features/0001-Parallel-World-Ticking.patch index 5a71ab3..86d249a 100644 --- a/sparklypaper-server/minecraft-patches/features/0001-Parallel-World-Ticking.patch +++ b/sparklypaper-server/minecraft-patches/features/0001-Parallel-World-Ticking.patch @@ -236,7 +236,7 @@ index ecfe237fbecde610d095647a1f2a10f7d426d786..7c178bd28880a8fea2bbae7cd0c81fa5 // Paper start - extra debug info if (entity.valid) { diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 53f038e1b5e7a13a08a0c925c8bd3f8a40868195..d6212fb075c02cc7a9e15ff9040e406fc12e4c51 100644 +index 53f038e1b5e7a13a08a0c925c8bd3f8a40868195..b7373b769a751a6381272915c6e424c7a661a11f 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -461,6 +461,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc @@ -259,7 +259,7 @@ index 53f038e1b5e7a13a08a0c925c8bd3f8a40868195..d6212fb075c02cc7a9e15ff9040e406f return this; } else { // CraftBukkit start -+ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot change dimension of a player off-main, from world " + serverLevel().getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs) ++ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot change dimension of a player off-main, from world " + serverLevel.getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs) /* this.isChangingDimension = true; LevelData levelData = level.getLevelData(); @@ -289,7 +289,7 @@ index 53f038e1b5e7a13a08a0c925c8bd3f8a40868195..d6212fb075c02cc7a9e15ff9040e406f // Paper end - Inventory close reason this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId)); diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index b1524279c02cd3be82338a6bd0320cb125a134d5..f628bd1fea97c2dba581f74c5aff5c5b888c4c9e 100644 +index b1524279c02cd3be82338a6bd0320cb125a134d5..9b291998bb5a5dcb94e2e6f8f1813a083fbb55a1 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java @@ -112,7 +112,7 @@ public abstract class PlayerList { @@ -324,9 +324,9 @@ index b1524279c02cd3be82338a6bd0320cb125a134d5..f628bd1fea97c2dba581f74c5aff5c5b public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, @Nullable org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, @Nullable org.bukkit.Location location) { + // SparklyPaper - parallel world ticking (additional concurrency issues logs) + if (location != null) // TODO: Is this really never null, or is IntelliJ IDEA tripping? Because I'm pretty sure that this can be null and there isn't any @NotNull annotations -+ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot respawn player off-main, from world " + player.serverLevel().getWorld().getName() + " to world " + location.getWorld().getName()); ++ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot respawn player off-main, from world " + player.level().getWorld().getName() + " to world " + location.getWorld().getName()); + else -+ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot respawn player off-main, respawning in world " + player.serverLevel().getWorld().getName()); ++ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot respawn player off-main, respawning in world " + player.level().getWorld().getName()); + // SparklyPaper end player.stopRiding(); // CraftBukkit this.players.remove(player); @@ -340,7 +340,7 @@ index b1524279c02cd3be82338a6bd0320cb125a134d5..f628bd1fea97c2dba581f74c5aff5c5b serverPlayer.connection = player.connection; serverPlayer.restoreFrom(player, keepInventory); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 9344cdbad8415f6ff4d592d3f13390e85477a10d..51481f4fd09e03690182165d44a6cd88f34910fe 100644 +index 9344cdbad8415f6ff4d592d3f13390e85477a10d..b862f751c582716bc44342418bf33467aeaf3d16 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -834,7 +834,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -356,7 +356,7 @@ index 9344cdbad8415f6ff4d592d3f13390e85477a10d..51481f4fd09e03690182165d44a6cd88 } private Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition teleportTransition) { -+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(level, "Cannot teleport entity to another world off-main, from world " + this.level.getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs) ++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(oldLevel, "Cannot teleport entity to another world off-main, from world " + oldLevel.getWorld().getName() + " to world " + newLevel.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs) List passengers = this.getPassengers(); List list = new ArrayList<>(passengers.size()); this.ejectPassengers(); @@ -551,7 +551,7 @@ index a22cb810622e0ae97bc2a0d6390d026d9482b783..7934299d633524a9ef8c9d315a48c0f5 java.util.List blocks = new java.util.ArrayList<>(level.capturedBlockStates.values()); level.capturedBlockStates.clear(); diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -index 5a094257a31f0500278a706a418e1697f8810ffb..2fde02112ae6e88ef017e8f148cf3ab543f43616 100644 +index 5a094257a31f0500278a706a418e1697f8810ffb..061c0f2422e46bad70df3b21ccb9e10a9e13ccaa 100644 --- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java +++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java @@ -76,6 +76,12 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co @@ -559,7 +559,7 @@ index 5a094257a31f0500278a706a418e1697f8810ffb..2fde02112ae6e88ef017e8f148cf3ab5 public static boolean canUnlock(Player player, LockCode code, Component displayName, @Nullable BlockEntity blockEntity) { + // SparklyPaper - parallel world ticking (see: PARALLEL_NOTES.md - Opening an inventory after a world switch) -+ if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer && blockEntity != null && blockEntity.getLevel() != serverPlayer.serverLevel()) { ++ if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer && blockEntity != null && blockEntity.getLevel() != serverPlayer.level()) { + net.minecraft.server.MinecraftServer.LOGGER.warn("Player " + serverPlayer.getScoreboardName() + " (" + serverPlayer.getStringUUID() + ") attempted to open a BlockEntity @ " + blockEntity.getLevel().getWorld().getName() + " " + blockEntity.getBlockPos().getX() + ", " + blockEntity.getBlockPos().getY() + ", " + blockEntity.getBlockPos().getZ() + " while they were in a different world " + serverPlayer.level().getWorld().getName() + " than the block themselves!"); + return false; + }