Use target level for waypoint modify command (#12933)
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user