diff --git a/bootstrap/bukkit/pom.xml b/bootstrap/bukkit/pom.xml
index 0f4d32885..0e5dd3df7 100644
--- a/bootstrap/bukkit/pom.xml
+++ b/bootstrap/bukkit/pom.xml
@@ -49,6 +49,10 @@
io.netty
org.geysermc.platform.bukkit.shaded.netty
+
+ it.unimi.dsi.fastutil
+ org.geysermc.platform.bukkit.shaded.fastutil
+
true
diff --git a/bootstrap/sponge/pom.xml b/bootstrap/sponge/pom.xml
index 1b1dd8e94..83c070aed 100644
--- a/bootstrap/sponge/pom.xml
+++ b/bootstrap/sponge/pom.xml
@@ -53,6 +53,10 @@
io.netty
org.geysermc.platform.sponge.shaded.netty
+
+ it.unimi.dsi.fastutil
+ org.geysermc.platform.sponge.shaded.fastutil
+
true
@@ -71,7 +75,6 @@
com.google.code.gson:*
org.yaml:*
- com.nukkitx:fastutil-lite:*
org.slf4j:*
org.ow2.asm:*
diff --git a/common/pom.xml b/common/pom.xml
index 1f6c20b7e..0a47fbcaa 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -18,5 +18,11 @@
2.8.2
compile
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.9.8
+ compile
+
\ No newline at end of file
diff --git a/common/src/main/java/org/geysermc/floodgate/util/BedrockData.java b/common/src/main/java/org/geysermc/floodgate/util/BedrockData.java
index 8beeb9987..a94a20727 100644
--- a/common/src/main/java/org/geysermc/floodgate/util/BedrockData.java
+++ b/common/src/main/java/org/geysermc/floodgate/util/BedrockData.java
@@ -3,6 +3,8 @@ package org.geysermc.floodgate.util;
import lombok.AllArgsConstructor;
import lombok.Getter;
+import java.util.UUID;
+
@AllArgsConstructor
@Getter
public class BedrockData {
@@ -11,15 +13,15 @@ public class BedrockData {
private String version;
private String username;
- private String xuid;
+ private UUID bedrockId;
private int deviceId;
private String languageCode;
private int inputMode;
private String ip;
private int dataLength;
- public BedrockData(String version, String username, String xuid, int deviceId, String languageCode, int inputMode, String ip) {
- this(version, username, xuid, deviceId, languageCode, inputMode, ip, EXPECTED_LENGTH);
+ public BedrockData(String version, String username, UUID bedrockId, int deviceId, String languageCode, int inputMode, String ip) {
+ this(version, username, bedrockId, deviceId, languageCode, inputMode, ip, EXPECTED_LENGTH);
}
public static BedrockData fromString(String data) {
@@ -27,7 +29,7 @@ public class BedrockData {
if (split.length != EXPECTED_LENGTH) return null;
return new BedrockData(
- split[0], split[1], split[2], Integer.parseInt(split[3]),
+ split[0], split[1], UUID.fromString(split[2]), Integer.parseInt(split[3]),
split[4], Integer.parseInt(split[5]), split[6], split.length
);
}
@@ -38,7 +40,7 @@ public class BedrockData {
@Override
public String toString() {
- return version +'\0'+ username +'\0'+ xuid +'\0'+ deviceId +'\0'+ languageCode +'\0'+
+ return version +'\0'+ username +'\0'+ bedrockId +'\0'+ deviceId +'\0'+ languageCode +'\0'+
inputMode +'\0'+ ip;
}
}
diff --git a/common/src/main/java/org/geysermc/floodgate/util/DeviceOS.java b/common/src/main/java/org/geysermc/floodgate/util/DeviceOS.java
new file mode 100644
index 000000000..ee14fc90b
--- /dev/null
+++ b/common/src/main/java/org/geysermc/floodgate/util/DeviceOS.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019-2020 GeyserMC. http://geysermc.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * @author GeyserMC
+ * @link https://github.com/GeyserMC/Geyser
+ */
+
+package org.geysermc.floodgate.util;
+
+import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
+
+public enum DeviceOS {
+
+ @JsonEnumDefaultValue
+ UNKNOWN,
+ ANDROID,
+ IOS,
+ OSX,
+ FIREOS,
+ GEARVR,
+ HOLOLENS,
+ WIN10,
+ WIN32,
+ DEDICATED,
+ ORBIS,
+ NX,
+ SWITCH;
+
+ private static final DeviceOS[] VALUES = values();
+
+ public static DeviceOS getById(int id) {
+ return id < VALUES.length ? VALUES[id] : VALUES[0];
+ }
+}
\ No newline at end of file
diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/monster/CreeperEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/monster/CreeperEntity.java
index 49a81d8e1..e99e1a63f 100644
--- a/connector/src/main/java/org/geysermc/connector/entity/living/monster/CreeperEntity.java
+++ b/connector/src/main/java/org/geysermc/connector/entity/living/monster/CreeperEntity.java
@@ -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());
}
diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
index acad78eaf..6a244a557 100644
--- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
+++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
@@ -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(),
diff --git a/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java b/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java
index 3793e5227..66536e069 100644
--- a/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java
+++ b/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java
@@ -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,
diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java
index 19d1a55f6..8091781aa 100644
--- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java
+++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java
@@ -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