Fix /fly command (#396)

* Fix /fly

* Add comment
This commit is contained in:
Camotoy 2020-04-21 15:36:13 -04:00 committed by GitHub
parent 1b15f3058f
commit aad4536990
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ package org.geysermc.connector.network.translators.java.entity.player;
import java.util.Set; import java.util.Set;
import com.nukkitx.protocol.bedrock.data.CommandPermission;
import org.geysermc.connector.entity.Entity; import org.geysermc.connector.entity.Entity;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.PacketTranslator; import org.geysermc.connector.network.translators.PacketTranslator;
@ -68,6 +69,8 @@ public class JavaPlayerAbilitiesTranslator extends PacketTranslator<ServerPlayer
AdventureSettingsPacket adventureSettingsPacket = new AdventureSettingsPacket(); AdventureSettingsPacket adventureSettingsPacket = new AdventureSettingsPacket();
adventureSettingsPacket.setPlayerPermission(PlayerPermission.MEMBER); adventureSettingsPacket.setPlayerPermission(PlayerPermission.MEMBER);
// Required or the packet simply is not sent
adventureSettingsPacket.setCommandPermission(CommandPermission.NORMAL);
adventureSettingsPacket.setUniqueEntityId(entity.getGeyserId()); adventureSettingsPacket.setUniqueEntityId(entity.getGeyserId());
adventureSettingsPacket.getFlags().addAll(playerFlags); adventureSettingsPacket.getFlags().addAll(playerFlags);
session.getUpstream().sendPacket(adventureSettingsPacket); session.getUpstream().sendPacket(adventureSettingsPacket);