Skip to content

Commit

Permalink
fixed vehicle dismounting
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Nov 21, 2023
1 parent 10e6d8f commit f4e918b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/net/rpgz/mixin/MobEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.mob.FlyingEntity;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -153,6 +154,16 @@ protected void updatePostDeath() {
}
}

@Override
public void onDeath(DamageSource damageSource) {
if (this.hasPassengers()) {
for (int i = 0; i < this.getPassengerList().size(); i++) {
this.getPassengerList().get(i).dismountVehicle();
}
}
super.onDeath(damageSource);
}

private void despawnParticlesServer() {
for (int i = 0; i < 20; ++i) {
double d = this.random.nextGaussian() * 0.025D;
Expand Down

0 comments on commit f4e918b

Please sign in to comment.