Begin remigrate to Shiroha
uhm
This commit is contained in:
@@ -14,7 +14,7 @@ index 625c013e99f41a7d64e301100139f1bf4ee3e2e1..7ae5cd4a30e56c8877ea505287eb66e8
|
||||
}
|
||||
|
||||
- private void checkRidingStatistics(final double dx, final double dy, final double dz) {
|
||||
+ public void checkRidingStatistics(final double dx, final double dy, final double dz) { // Camellia - Fix riding statics desync - make public
|
||||
+ public void checkRidingStatistics(final double dx, final double dy, final double dz) { // Shiroha - Fix riding statics desync - make public
|
||||
if (this.isPassenger() && !didNotMove(dx, dy, dz)) {
|
||||
int distance = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
|
||||
Entity vehicle = this.getVehicle();
|
||||
@@ -26,13 +26,13 @@ index a3f473cab6a37e65de233c7f77d9de7c967fcdd0..1bf85a60b3223c9a44bb3e3d6bffe8eb
|
||||
}
|
||||
}
|
||||
|
||||
+ // Camellia start - Fix riding statics desync
|
||||
+ // Shiroha start - Fix riding statics desync
|
||||
public void adjustRiders(boolean teleport) {
|
||||
+ this.adjustRiders(teleport, false);
|
||||
+ }
|
||||
+
|
||||
+ public void adjustRiders(boolean teleport, boolean syncStatics) {
|
||||
+ // Camellia end - Fix riding statics desync
|
||||
+ // Shiroha end - Fix riding statics desync
|
||||
java.util.ArrayDeque<EntityTreeNode> queue = new java.util.ArrayDeque<>();
|
||||
queue.add(this);
|
||||
|
||||
@@ -40,17 +40,17 @@ index a3f473cab6a37e65de233c7f77d9de7c967fcdd0..1bf85a60b3223c9a44bb3e3d6bffe8eb
|
||||
|
||||
for (EntityTreeNode passenger : passengers) {
|
||||
queue.add(passenger);
|
||||
+ // Camellia start - Fix riding statics desync
|
||||
+ // Shiroha start - Fix riding statics desync
|
||||
+ final double oldX = passenger.root.getX();
|
||||
+ final double oldY = passenger.root.getY();
|
||||
+ final double oldZ = passenger.root.getZ();
|
||||
+ // Camellia end - Fix riding statics desync
|
||||
+ // Shiroha end - Fix riding statics desync
|
||||
curr.root.positionRider(passenger.root, teleport ? Entity::snapTo : Entity::setPos);
|
||||
+ // Camellia start - Fix riding statics desync
|
||||
+ // Shiroha start - Fix riding statics desync
|
||||
+ if (syncStatics && passenger.root instanceof net.minecraft.server.level.ServerPlayer serverPlayer) {
|
||||
+ serverPlayer.checkRidingStatistics(serverPlayer.getX() - oldX, serverPlayer.getY() - oldY, serverPlayer.getZ() - oldZ);
|
||||
+ }
|
||||
+ // Camellia end - Fix riding statics desync
|
||||
+ // Shiroha end - Fix riding statics desync
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ index a3f473cab6a37e65de233c7f77d9de7c967fcdd0..1bf85a60b3223c9a44bb3e3d6bffe8eb
|
||||
|
||||
public void repositionAllPassengers(boolean teleport) {
|
||||
- this.makePassengerTree().adjustRiders(teleport);
|
||||
+ this.makePassengerTree().adjustRiders(teleport, true); // Camellia - Fix riding statics desync
|
||||
+ this.makePassengerTree().adjustRiders(teleport, true); // Shiroha - Fix riding statics desync
|
||||
}
|
||||
|
||||
protected EntityTreeNode makePassengerTree() {
|
||||
|
||||
Reference in New Issue
Block a user