|
200 | 200 | if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper - Perf: Disable Scoreboards for non players by default |
201 | 201 | return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName()); |
202 | 202 | } |
203 | | -@@ -3726,8 +_,782 @@ |
| 203 | +@@ -3726,8 +_,789 @@ |
204 | 204 | this.portalProcess = entity.portalProcess; |
205 | 205 | } |
206 | 206 |
|
|
589 | 589 | + ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(pos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(pos) |
590 | 590 | + ) |
591 | 591 | + ) { |
| 592 | ++ boolean hasPassengers = !this.passengers.isEmpty(); |
592 | 593 | + EntityTreeNode passengerTree = this.detachPassengers(); |
593 | | -+ // Note: The client does not accept position updates for controlled entities. So, we must |
594 | | -+ // perform a lot of tracker updates here to make it all work out. |
595 | 594 | + |
596 | | -+ // first, clear the tracker |
597 | | -+ passengerTree.clearTracker(); |
| 595 | ++ if (hasPassengers) { |
| 596 | ++ // Note: The client does not accept position updates for controlled entities. So, we must |
| 597 | ++ // perform a lot of tracker updates here to make it all work out. |
| 598 | ++ |
| 599 | ++ // first, clear the tracker |
| 600 | ++ passengerTree.clearTracker(); |
| 601 | ++ } |
| 602 | ++ |
598 | 603 | + for (EntityTreeNode entity : passengerTree.getFullTree()) { |
599 | 604 | + entity.root.teleportSyncSameRegion(pos, yaw, pitch, velocity); |
600 | 605 | + } |
601 | 606 | + |
602 | | -+ passengerTree.restore(); |
603 | | -+ // re-add to the tracker once the tree is restored |
604 | | -+ passengerTree.addTracker(); |
| 607 | ++ if (hasPassengers) { |
| 608 | ++ passengerTree.restore(); |
| 609 | ++ // re-add to the tracker once the tree is restored |
| 610 | ++ passengerTree.addTracker(); |
605 | 611 | + |
606 | | -+ // adjust entities to final position |
607 | | -+ passengerTree.adjustRiders(true); |
| 612 | ++ // adjust entities to final position |
| 613 | ++ passengerTree.adjustRiders(true); |
608 | 614 | + |
609 | | -+ // the tracker clear/add logic is only used in the same region, as the other logic |
610 | | -+ // performs add/remove from world logic which will also perform add/remove tracker logic |
| 615 | ++ // the tracker clear/add logic is only used in the same region, as the other logic |
| 616 | ++ // performs add/remove from world logic which will also perform add/remove tracker logic |
| 617 | ++ } |
611 | 618 | + |
612 | 619 | + if (teleportComplete != null) { |
613 | 620 | + teleportComplete.accept(this); |
|
0 commit comments