Fix abilities not updating properly
This commit is contained in:
parent
4b5f07b37c
commit
37b1ebeae5
@ -1180,8 +1180,10 @@ public class PatchBukkitPlayer
|
||||
|
||||
@Override
|
||||
public void setAllowFlight(boolean flight) {
|
||||
var abilities = NativePatchBukkit.getAbilities(this.uuid);
|
||||
abilities.withAllowFlying(flight);
|
||||
var abilities = NativePatchBukkit.getAbilities(this.uuid).withAllowFlying(flight);
|
||||
if (flight == false) {
|
||||
abilities = abilities.withFlying(false);
|
||||
}
|
||||
NativePatchBukkit.setAbilities(this.uuid, abilities);
|
||||
}
|
||||
|
||||
@ -1259,8 +1261,7 @@ public class PatchBukkitPlayer
|
||||
|
||||
@Override
|
||||
public void setFlying(boolean value) {
|
||||
var abilities = NativePatchBukkit.getAbilities(this.getUniqueId());
|
||||
abilities.withFlying(value);
|
||||
var abilities = NativePatchBukkit.getAbilities(this.getUniqueId()).withFlying(value);
|
||||
NativePatchBukkit.setAbilities(this.getUniqueId(), abilities);
|
||||
}
|
||||
|
||||
|
||||
@ -54,6 +54,11 @@ pub extern "C" fn rust_set_abilities(
|
||||
})
|
||||
});
|
||||
|
||||
let player = player.clone();
|
||||
ctx.runtime.spawn(async move {
|
||||
player.send_abilities_update().await;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user