Use target level for waypoint modify command (#12933)

This commit is contained in:
Pedro
2025-08-07 06:36:23 -04:00
committed by GitHub
parent 846c64f4d1
commit 6d0833ece5
@@ -0,0 +1,11 @@
--- a/net/minecraft/server/commands/WaypointCommand.java
+++ b/net/minecraft/server/commands/WaypointCommand.java
@@ -165,7 +_,7 @@
}
private static void mutateIcon(CommandSourceStack source, WaypointTransmitter waypoint, Consumer<Waypoint.Icon> mutator) {
- ServerLevel level = source.getLevel();
+ ServerLevel level = (waypoint instanceof LivingEntity livingEntity) ? (net.minecraft.server.level.ServerLevel) livingEntity.level() : source.getLevel(); // Paper - MC-300685 use level of waypoint if it's a living entity for broadcast
level.getWaypointManager().untrackWaypoint(waypoint);
mutator.accept(waypoint.waypointIcon());
level.getWaypointManager().trackWaypoint(waypoint);