forked from GeyserMC/Geyser
Merge branch 'master' into inventory
This commit is contained in:
commit
6eac178305
9 changed files with 82 additions and 26 deletions
|
@ -39,6 +39,9 @@ public class CreeperEntity extends MonsterEntity {
|
|||
|
||||
@Override
|
||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||
if (entityMetadata.getId() == 15 && (int) entityMetadata.getValue() > 0) {
|
||||
metadata.getFlags().setFlag(EntityFlag.IGNITED, true);
|
||||
}
|
||||
if (entityMetadata.getId() == 16) {
|
||||
metadata.getFlags().setFlag(EntityFlag.POWERED, (boolean) entityMetadata.getValue());
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ public class GeyserSession implements CommandSender {
|
|||
encrypted = EncryptionUtil.encryptBedrockData(publicKey, new BedrockData(
|
||||
clientData.getGameVersion(),
|
||||
authData.getName(),
|
||||
authData.getXboxUUID(),
|
||||
authData.getUUID(),
|
||||
clientData.getDeviceOS().ordinal(),
|
||||
clientData.getLanguageCode(),
|
||||
clientData.getCurrentInputMode().ordinal(),
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import org.geysermc.floodgate.util.DeviceOS;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -65,23 +66,6 @@ public class BedrockClientData {
|
|||
POCKET
|
||||
}
|
||||
|
||||
public enum DeviceOS {
|
||||
@JsonEnumDefaultValue
|
||||
UNKOWN,
|
||||
ANDROID,
|
||||
IOS,
|
||||
OSX,
|
||||
FIREOS,
|
||||
GEARVR,
|
||||
HOLOLENS,
|
||||
WIN10,
|
||||
WIN32,
|
||||
DEDICATED,
|
||||
ORBIS,
|
||||
NX,
|
||||
SWITCH
|
||||
}
|
||||
|
||||
public enum InputMode {
|
||||
@JsonEnumDefaultValue
|
||||
UNKNOWN,
|
||||
|
|
|
@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.ClientChatPacket;
|
|||
import com.nukkitx.protocol.bedrock.packet.CommandRequestPacket;
|
||||
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.command.GeyserCommandMap;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.network.translators.PacketTranslator;
|
||||
|
||||
|
@ -37,8 +38,9 @@ public class BedrockCommandRequestTranslator extends PacketTranslator<CommandReq
|
|||
@Override
|
||||
public void translate(CommandRequestPacket packet, GeyserSession session) {
|
||||
String command = packet.getCommand().replace("/", "");
|
||||
if (GeyserConnector.getInstance().getCommandMap().getCommands().containsKey(command)) {
|
||||
GeyserConnector.getInstance().getCommandMap().runCommand(session, command);
|
||||
GeyserCommandMap commandMap = GeyserConnector.getInstance().getCommandMap();
|
||||
if (command.startsWith("geyser ") && commandMap.getCommands().containsKey(command.split(" ")[1])) {
|
||||
commandMap.runCommand(session, command);
|
||||
} else {
|
||||
ClientChatPacket chatPacket = new ClientChatPacket(packet.getCommand());
|
||||
session.getDownstream().getSession().send(chatPacket);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue