From 0e355c1a956307195b2a8e46579156ea1040ec16 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Fri, 6 Mar 2020 19:27:12 -0600 Subject: [PATCH 1/5] Fix natural creeper explosion animation not showing up --- .../connector/entity/living/monster/CreeperEntity.java | 3 +++ 1 file changed, 3 insertions(+) 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 49a81d8e..e99e1a63 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()); } From 9e203d48aa7c0848a50a8041282a19b48a4fe793 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Fri, 6 Mar 2020 19:37:35 -0600 Subject: [PATCH 2/5] Fix running Geyser commands ingame --- .../bedrock/BedrockCommandRequestTranslator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 19d1a55f..8091781a 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 Date: Sun, 8 Mar 2020 11:45:00 -0500 Subject: [PATCH 3/5] Move DeviceOS to common module --- common/pom.xml | 6 +++ .../org/geysermc/floodgate/util/DeviceOS.java | 52 +++++++++++++++++++ .../session/auth/BedrockClientData.java | 18 +------ 3 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 common/src/main/java/org/geysermc/floodgate/util/DeviceOS.java diff --git a/common/pom.xml b/common/pom.xml index 1f6c20b7..0a47fbca 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/DeviceOS.java b/common/src/main/java/org/geysermc/floodgate/util/DeviceOS.java new file mode 100644 index 00000000..ee14fc90 --- /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/network/session/auth/BedrockClientData.java b/connector/src/main/java/org/geysermc/connector/network/session/auth/BedrockClientData.java index 3793e522..66536e06 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, From 37d377b483aa63fc9c73b4259f7837c4de1896d0 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Mon, 9 Mar 2020 21:32:19 +0100 Subject: [PATCH 4/5] Floodgate now uses identity instead of xuid --- .../org/geysermc/floodgate/util/BedrockData.java | 12 +++++++----- .../connector/network/session/GeyserSession.java | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) 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 8beeb998..a94a2072 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/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index a2d8a726..b443f963 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 @@ -221,7 +221,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(), From c7f1f0b71f968335a6d40a9ff3f980152f7588d6 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Tue, 10 Mar 2020 18:40:22 -0500 Subject: [PATCH 5/5] Shade in fastutil for Sponge and relocate to shaded package (Fixes #198) --- bootstrap/bukkit/pom.xml | 4 ++++ bootstrap/sponge/pom.xml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap/bukkit/pom.xml b/bootstrap/bukkit/pom.xml index 0f4d3288..0e5dd3df 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 1b1dd8e9..83c070ae 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:*