mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Remove previous passengers when picking up an entity. Fixes #25
This commit is contained in:
parent
1bcba1c08d
commit
a544724751
1 changed files with 4 additions and 2 deletions
|
@ -56,10 +56,12 @@ public class CarryAbility implements Ability<Hit> {
|
||||||
PlayerEntity player = iplayer.getMaster();
|
PlayerEntity player = iplayer.getMaster();
|
||||||
LivingEntity rider = findRider(player, iplayer.getWorld());
|
LivingEntity rider = findRider(player, iplayer.getWorld());
|
||||||
|
|
||||||
|
if (player.hasPassengers()) {
|
||||||
|
player.removeAllPassengers();
|
||||||
|
}
|
||||||
|
|
||||||
if (rider != null) {
|
if (rider != null) {
|
||||||
rider.startRiding(player, true);
|
rider.startRiding(player, true);
|
||||||
} else {
|
|
||||||
player.removeAllPassengers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player instanceof ServerPlayerEntity) {
|
if (player instanceof ServerPlayerEntity) {
|
||||||
|
|
Loading…
Reference in a new issue