尝试阻止外部stopRiding#2
This commit is contained in:
parent
911c616f22
commit
4bfb9e1675
1 changed files with 3 additions and 2 deletions
|
@ -44,8 +44,9 @@ public class LivingEntityMixin implements ICustomKnockback {
|
|||
|
||||
@Inject(method = "stopRiding()V", at = @At("HEAD"), cancellable = true)
|
||||
public void stopRiding(CallbackInfo ci) {
|
||||
Entity entity = ((LivingEntity) (Object) this).getVehicle();
|
||||
if (entity instanceof VehicleEntity) {
|
||||
var living = ((LivingEntity) (Object) this);
|
||||
Entity entity = living.getVehicle();
|
||||
if (entity instanceof VehicleEntity && living instanceof Player) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue