From 37a77441736ce66bce6621ceaaf3c2b386bb3868 Mon Sep 17 00:00:00 2001 From: Redned Date: Sat, 30 Nov 2019 20:56:39 -0600 Subject: [PATCH 01/10] Include submodules in pull request build action --- .github/workflows/pullrequest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index bea51a6e..bf5972f2 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -19,6 +19,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: submodules-init + uses: snickerbockers/submodules-init@v4 - name: Build with Maven run: mvn -B package - name: Archive artifacts From fe6b0e8afa9d7bd48f30fdbeb34b65b5df054900 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Tue, 3 Dec 2019 18:43:52 -0600 Subject: [PATCH 02/10] Update mappings submodule --- connector/src/main/resources/mappings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/resources/mappings b/connector/src/main/resources/mappings index 5ec6f1f3..3d4147f0 160000 --- a/connector/src/main/resources/mappings +++ b/connector/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit 5ec6f1f339506129514de59d0e09e9b2c612e8be +Subproject commit 3d4147f001266d01eae6b8479428ca77bb5bf0c3 From 83d943e426adffbf9980df1d69fb3f8538247e11 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Tue, 3 Dec 2019 18:49:13 -0600 Subject: [PATCH 03/10] Only set variant for actual horses (Fixes #99) --- .../entity/living/AbstractHorseEntity.java | 4 -- .../entity/living/horse/HorseEntity.java | 49 +++++++++++++++++++ .../connector/entity/type/EntityType.java | 3 +- 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 connector/src/main/java/org/geysermc/connector/entity/living/horse/HorseEntity.java diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/AbstractHorseEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/AbstractHorseEntity.java index c5ac8d2c..7b71d040 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/living/AbstractHorseEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/living/AbstractHorseEntity.java @@ -39,10 +39,6 @@ public class AbstractHorseEntity extends AnimalEntity { @Override public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) { - if (entityMetadata.getId() == 17) { - metadata.put(EntityData.VARIANT, (int) entityMetadata.getValue()); - } - super.updateBedrockMetadata(entityMetadata, session); } } diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/horse/HorseEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/horse/HorseEntity.java new file mode 100644 index 00000000..3ad0b114 --- /dev/null +++ b/connector/src/main/java/org/geysermc/connector/entity/living/horse/HorseEntity.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 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.connector.entity.living.horse; + +import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata; +import com.nukkitx.math.vector.Vector3f; +import com.nukkitx.protocol.bedrock.data.EntityData; +import org.geysermc.connector.entity.living.AbstractHorseEntity; +import org.geysermc.connector.entity.type.EntityType; +import org.geysermc.connector.network.session.GeyserSession; + +public class HorseEntity extends AbstractHorseEntity { + + public HorseEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation) { + super(entityId, geyserId, entityType, position, motion, rotation); + } + + @Override + public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) { + if (entityMetadata.getId() == 17) { + metadata.put(EntityData.VARIANT, (int) entityMetadata.getValue()); + } + + super.updateBedrockMetadata(entityMetadata, session); + } +} diff --git a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java index 37ee1b0a..dab04a1d 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java +++ b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java @@ -28,6 +28,7 @@ package org.geysermc.connector.entity.type; import lombok.Getter; import org.geysermc.connector.entity.*; import org.geysermc.connector.entity.living.*; +import org.geysermc.connector.entity.living.horse.HorseEntity; import org.geysermc.connector.entity.living.monster.GuardianEntity; import org.geysermc.connector.entity.living.monster.ZombieEntity; @@ -47,7 +48,7 @@ public enum EntityType { IRON_GOLEM(GolemEntity.class, 20, 2.7f, 1.4f), SNOW_GOLEM(GolemEntity.class, 21, 1.9f, 0.7f), OCELOT(TameableEntity.class, 22, 0.35f, 0.3f), - HORSE(AbstractHorseEntity.class, 23, 1.6f, 1.3965f), + HORSE(HorseEntity.class, 23, 1.6f, 1.3965f), DONKEY(ChestedHorseEntity.class, 24, 1.6f, 1.3965f), MULE(ChestedHorseEntity.class, 25, 1.6f, 1.3965f), SKELETON_HORSE(AbstractHorseEntity.class, 26, 1.6f, 1.3965f), From 8389cab95cb2f087303f5db2d25c434ef8475bfc Mon Sep 17 00:00:00 2001 From: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com> Date: Wed, 4 Dec 2019 18:02:27 +0000 Subject: [PATCH 04/10] Bump Protocol Lib to 1.4.1 --- connector/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/pom.xml b/connector/pom.xml index 60ecfc55..70f74df4 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -74,7 +74,7 @@ com.nukkitx.protocol bedrock-v388 - 2.4.0 + 2.4.1 compile From 6e8a0847b402beceb0b237b1d9bb215652986eea Mon Sep 17 00:00:00 2001 From: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com> Date: Wed, 4 Dec 2019 18:13:49 +0000 Subject: [PATCH 05/10] Fix typo from protocol lib --- .../connector/network/session/GeyserSession.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 8f4544d3..8fedc583 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 @@ -44,13 +44,7 @@ import com.nukkitx.nbt.tag.CompoundTag; import com.nukkitx.protocol.bedrock.BedrockServerSession; import com.nukkitx.protocol.bedrock.data.GamePublishSetting; import com.nukkitx.protocol.bedrock.data.GameRule; -import com.nukkitx.protocol.bedrock.packet.AvailableEntityIdentifiersPacket; -import com.nukkitx.protocol.bedrock.packet.BiomeDefinitionListPacket; -import com.nukkitx.protocol.bedrock.packet.LevelChunkPacket; -import com.nukkitx.protocol.bedrock.packet.NetworkChunkPublisherUpdatePacket; -import com.nukkitx.protocol.bedrock.packet.PlayStatusPacket; -import com.nukkitx.protocol.bedrock.packet.StartGamePacket; -import com.nukkitx.protocol.bedrock.packet.TextPacket; +import com.nukkitx.protocol.bedrock.packet.*; import lombok.Getter; import lombok.Setter; import org.geysermc.api.Player; @@ -295,7 +289,7 @@ public class GeyserSession implements Player { startGamePacket.setLevelGamemode(0); startGamePacket.setDifficulty(1); startGamePacket.setDefaultSpawn(Vector3i.ZERO); - startGamePacket.setAcheivementsDisabled(true); + startGamePacket.setAchievementsDisabled(true); startGamePacket.setTime(-1); startGamePacket.setEduEditionOffers(0); startGamePacket.setEduFeaturesEnabled(false); From 855a25389441719641b6c05be6f37218fcaad8f0 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 4 Dec 2019 22:41:56 -0600 Subject: [PATCH 06/10] Add cat entity --- .../java/org/geysermc/connector/entity/type/EntityType.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java index dab04a1d..73c48410 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java +++ b/connector/src/main/java/org/geysermc/connector/entity/type/EntityType.java @@ -102,8 +102,7 @@ public enum EntityType { FIREWORK_ROCKET(Entity.class, 72, 0f), TRIDENT(ArrowEntity.class, 73, 0f), TURTLE(AnimalEntity.class, 74, 0.4f, 1.2f), - // TODO CAT (need to figure out how to deal with baby cats) https://github.com/NukkitX/Nukkit/blob/master/src/main/java/cn/nukkit/entity/passive/EntityCat.java - + CAT(TameableEntity.class, 75, 0.35f, 0.3f), SHULKER_BULLET(Entity.class, 76, 0f), FISHING_BOBBER(Entity.class, 77, 0f), CHALKBOARD(Entity.class, 78, 0f), From a639d141e75f9388c90089c0bcfd02f25b1ab7f4 Mon Sep 17 00:00:00 2001 From: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com> Date: Thu, 5 Dec 2019 14:32:39 +0000 Subject: [PATCH 07/10] Bump Protocol lib to 2.4.2 --- connector/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/pom.xml b/connector/pom.xml index 70f74df4..1674eb64 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -74,7 +74,7 @@ com.nukkitx.protocol bedrock-v388 - 2.4.1 + 2.4.2 compile From fd95b8b36a4de83f8c239dc727bc1eca3d473a82 Mon Sep 17 00:00:00 2001 From: AJ Ferguson Date: Thu, 5 Dec 2019 21:54:29 -0900 Subject: [PATCH 08/10] Slightly improve movement A lot more work is needed to fix movement. --- .../translators/bedrock/BedrockMovePlayerTranslator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java index 678956d7..d07e922d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMovePlayerTranslator.java @@ -64,7 +64,7 @@ public class BedrockMovePlayerTranslator extends PacketTranslator Date: Fri, 6 Dec 2019 11:02:31 +0000 Subject: [PATCH 09/10] General pom cleanup. --- api/pom.xml | 6 --- common/pom.xml | 46 ------------------- connector/pom.xml | 13 +----- .../geysermc/connector/utils/SkinUtils.java | 4 +- pom.xml | 37 ++++----------- 5 files changed, 13 insertions(+), 93 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index a0cbdf87..6d4e1c85 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -10,12 +10,6 @@ api - - org.projectlombok - lombok - 1.18.4 - compile - com.google.code.gson gson diff --git a/common/pom.xml b/common/pom.xml index 6a0a6ff0..cd96ad23 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -9,50 +9,4 @@ 1.0-SNAPSHOT common - - - com.github.steveice10 - opennbt - 1.3-SNAPSHOT - compile - - - com.github.steveice10 - packetlib - 1.4-SNAPSHOT - compile - - - com.github.steveice10 - mcauthlib - 1.1-SNAPSHOT - compile - - - com.github.steveice10 - mcprotocollib - 1.14.4-SNAPSHOT - compile - - - com.github.steveice10 - opennbt - - - com.github.steveice10 - packetlib - - - com.github.steveice10 - mcauthlib - - - - - com.auth0 - java-jwt - 3.3.0 - compile - - \ No newline at end of file diff --git a/connector/pom.xml b/connector/pom.xml index 70f74df4..d03c2ec1 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -44,7 +44,6 @@ net.minecrell terminalconsoleappender 1.0.0 - jar compile @@ -59,12 +58,6 @@ 1.6.4 compile - - org.projectlombok - lombok - 1.18.4 - provided - org.fusesource.jansi jansi @@ -129,7 +122,7 @@ - ${outputName}-noshade + ${project.parent.name} ../target @@ -146,9 +139,6 @@ org.apache.maven.plugins maven-javadoc-plugin - - ${outputName} - org.apache.maven.plugins @@ -162,7 +152,6 @@ - ${outputName} true true diff --git a/connector/src/main/java/org/geysermc/connector/utils/SkinUtils.java b/connector/src/main/java/org/geysermc/connector/utils/SkinUtils.java index b4c9d7f6..91910c96 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/SkinUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/SkinUtils.java @@ -7,12 +7,12 @@ import com.nukkitx.protocol.bedrock.data.SerializedSkin; import com.nukkitx.protocol.bedrock.packet.PlayerListPacket; import lombok.AllArgsConstructor; import lombok.Getter; -import org.apache.commons.codec.Charsets; import org.geysermc.api.Geyser; import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.entity.PlayerEntity; import org.geysermc.connector.network.session.GeyserSession; +import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Collections; import java.util.UUID; @@ -80,7 +80,7 @@ public class SkinUtils { try { GameProfile.Property skinProperty = profile.getProperty("textures"); - JsonObject skinObject = SkinProvider.GSON.fromJson(new String(Base64.getDecoder().decode(skinProperty.getValue()), Charsets.UTF_8), JsonObject.class); + JsonObject skinObject = SkinProvider.GSON.fromJson(new String(Base64.getDecoder().decode(skinProperty.getValue()), StandardCharsets.UTF_8), JsonObject.class); JsonObject textures = skinObject.getAsJsonObject("textures"); JsonObject skinTexture = textures.getAsJsonObject("SKIN"); diff --git a/pom.xml b/pom.xml index 79b7b5a1..2f394b5a 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ geyser-parent 1.0-SNAPSHOT pom - GeyserMC + Geyser Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers. https://geysermc.org @@ -83,33 +83,16 @@ + + + org.projectlombok + lombok + 1.18.4 + provided + + + clean install - - - src/main/resources/ - false - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-shade-plugin - 3.1.0 - - false - true - - - From 9c21bcc9e8dfc90f32bc777bbd92df7c688aa031 Mon Sep 17 00:00:00 2001 From: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com> Date: Fri, 6 Dec 2019 11:08:25 +0000 Subject: [PATCH 10/10] Add back target fixes. --- connector/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connector/pom.xml b/connector/pom.xml index d03c2ec1..eec15583 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -122,7 +122,7 @@ - ${project.parent.name} + ${project.parent.name}-noshade ../target @@ -139,6 +139,9 @@ org.apache.maven.plugins maven-javadoc-plugin + + ${project.parent.name} + org.apache.maven.plugins @@ -152,6 +155,7 @@ + ${project.parent.name} true true