mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix elytra gliding
This commit is contained in:
parent
086f62289f
commit
5f48d92a00
1 changed files with 16 additions and 8 deletions
|
|
@ -121,14 +121,10 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
|
|||
}
|
||||
}
|
||||
case START_GLIDE -> {
|
||||
// Otherwise gliding will not work in creative
|
||||
ServerboundPlayerAbilitiesPacket playerAbilitiesPacket = new ServerboundPlayerAbilitiesPacket(false);
|
||||
session.sendDownstreamGamePacket(playerAbilitiesPacket);
|
||||
}
|
||||
case STOP_GLIDE -> {
|
||||
ServerboundPlayerCommandPacket glidePacket = new ServerboundPlayerCommandPacket(entity.getEntityId(), PlayerState.START_ELYTRA_FLYING);
|
||||
session.sendDownstreamGamePacket(glidePacket);
|
||||
stopPlayerFlyingAbilities(session, entity);
|
||||
sendPlayerGlideState(session, entity);
|
||||
}
|
||||
case STOP_GLIDE -> sendPlayerGlideState(session, entity);
|
||||
case START_SNEAK -> {
|
||||
ServerboundPlayerCommandPacket startSneakPacket = new ServerboundPlayerCommandPacket(entity.getEntityId(), PlayerState.START_SNEAKING);
|
||||
session.sendDownstreamGamePacket(startSneakPacket);
|
||||
|
|
@ -275,7 +271,8 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
|
|||
session.sendUpstreamPacket(stopBreak);
|
||||
}
|
||||
// Handled in BedrockInventoryTransactionTranslator
|
||||
case STOP_BREAK -> {}
|
||||
case STOP_BREAK -> {
|
||||
}
|
||||
case DIMENSION_CHANGE_SUCCESS -> {
|
||||
//sometimes the client doesn't feel like loading
|
||||
PlayStatusPacket spawnPacket = new PlayStatusPacket();
|
||||
|
|
@ -380,4 +377,15 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
|
|||
levelEventPacket.setData(session.getBlockMappings().getBedrockBlock(blockState).getRuntimeId());
|
||||
session.sendUpstreamPacket(levelEventPacket);
|
||||
}
|
||||
|
||||
private void sendPlayerGlideState(GeyserSession session, Entity entity) {
|
||||
ServerboundPlayerCommandPacket glidePacket = new ServerboundPlayerCommandPacket(entity.getEntityId(), PlayerState.START_ELYTRA_FLYING);
|
||||
session.sendDownstreamGamePacket(glidePacket);
|
||||
}
|
||||
|
||||
private void stopPlayerFlyingAbilities(GeyserSession session, Entity entity) {
|
||||
// Otherwise gliding will not work in creative
|
||||
ServerboundPlayerAbilitiesPacket playerAbilitiesPacket = new ServerboundPlayerAbilitiesPacket(false);
|
||||
session.sendDownstreamGamePacket(playerAbilitiesPacket);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue