mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-25 14:14:32 +01:00
Fixed entities jumping back to their original position when being dropped by a pegasus
This commit is contained in:
parent
7ca2e63fae
commit
db52d53d06
1 changed files with 8 additions and 0 deletions
|
@ -1,11 +1,15 @@
|
||||||
package com.minelittlepony.unicopia.ability;
|
package com.minelittlepony.unicopia.ability;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.StreamSupport;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.Race;
|
import com.minelittlepony.unicopia.Race;
|
||||||
import com.minelittlepony.unicopia.ability.data.Hit;
|
import com.minelittlepony.unicopia.ability.data.Hit;
|
||||||
import com.minelittlepony.unicopia.entity.Living;
|
import com.minelittlepony.unicopia.entity.Living;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
import com.minelittlepony.unicopia.util.TraceHelper;
|
import com.minelittlepony.unicopia.util.TraceHelper;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -68,7 +72,11 @@ public class CarryAbility implements Ability<Hit> {
|
||||||
LivingEntity rider = findRider(player, iplayer.asWorld());
|
LivingEntity rider = findRider(player, iplayer.asWorld());
|
||||||
|
|
||||||
if (player.hasPassengers()) {
|
if (player.hasPassengers()) {
|
||||||
|
List<Entity> passengers = StreamSupport.stream(player.getPassengersDeep().spliterator(), false).toList();
|
||||||
player.removeAllPassengers();
|
player.removeAllPassengers();
|
||||||
|
for (Entity passenger : passengers) {
|
||||||
|
passenger.refreshPositionAfterTeleport(player.getPos());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rider != null) {
|
if (rider != null) {
|
||||||
|
|
Loading…
Reference in a new issue