From 99745d628e1ad2ebfe7140c50fc3cff93339adda Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 17 Jul 2019 12:47:21 -0500 Subject: [PATCH 1/4] Bump Bedrock protocol library with various fixes --- connector/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml index 0d95ab97..d0cbf8ef 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -62,7 +62,7 @@ com.nukkitx.protocol bedrock-v361 - 2.1.0 + 2.1.1 compile @@ -74,13 +74,13 @@ com.nukkitx.protocol bedrock-v354 - 2.1.0 + 2.1.1 compile com.nukkitx.protocol bedrock-v340 - 2.1.0 + 2.1.1 compile From 60cd379086b33d228107ac3c91f7ecf55cea9419 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 17 Jul 2019 12:51:05 -0500 Subject: [PATCH 2/4] Remove revision --- api/pom.xml | 2 +- common/pom.xml | 2 +- connector/pom.xml | 6 +++--- plugin/pom.xml | 2 +- pom.xml | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index eb6b8c20..31487d7c 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - ${revision} + 1.0-SNAPSHOT api diff --git a/common/pom.xml b/common/pom.xml index f3a8b2d2..104c4cbc 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - ${revision} + 1.0-SNAPSHOT common diff --git a/connector/pom.xml b/connector/pom.xml index d0cbf8ef..479a479e 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -6,20 +6,20 @@ org.geysermc geyser-parent - ${revision} + 1.0-SNAPSHOT connector org.geysermc api - ${revision} + 1.0-SNAPSHOT compile org.geysermc common - ${revision} + 1.0-SNAPSHOT compile diff --git a/plugin/pom.xml b/plugin/pom.xml index 4787342b..bb5febc4 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - ${revision} + 1.0-SNAPSHOT plugin \ No newline at end of file diff --git a/pom.xml b/pom.xml index 60102b80..cd9dc69a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.geysermc geyser-parent - ${revision} + 1.0-SNAPSHOT pom GeyserMC Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers. @@ -16,7 +16,6 @@ UTF-8 1.8 1.8 - 1.0-SNAPSHOT GeyserMC From c85e5b019fb657b3a55ee82fd863f55b03747eac Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 17 Jul 2019 13:00:11 -0500 Subject: [PATCH 3/4] Code cleanups --- .../main/java/org/geysermc/api/GeyserAPI.java | 4 -- .../geysermc/connector/GeyserConnector.java | 8 ---- .../network/translators/Registry.java | 26 ++++++++++++- .../network/translators/TranslatorsInit.java | 25 ++++++++++++ .../org/geysermc/connector/utils/Toolbox.java | 38 ++++++++++++++----- 5 files changed, 78 insertions(+), 23 deletions(-) delete mode 100644 api/src/main/java/org/geysermc/api/GeyserAPI.java diff --git a/api/src/main/java/org/geysermc/api/GeyserAPI.java b/api/src/main/java/org/geysermc/api/GeyserAPI.java deleted file mode 100644 index ba440585..00000000 --- a/api/src/main/java/org/geysermc/api/GeyserAPI.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.geysermc.api; - -public class GeyserAPI { -} diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 443b6ad5..3c4879f1 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -27,20 +27,12 @@ package org.geysermc.connector; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.nukkitx.network.raknet.RakNetServer; -import com.nukkitx.network.raknet.RakNetServerListener; -import com.nukkitx.network.raknet.RakNetServerSession; import com.nukkitx.protocol.bedrock.BedrockPacketCodec; import com.nukkitx.protocol.bedrock.BedrockServer; import com.nukkitx.protocol.bedrock.v361.Bedrock_v361; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.socket.DatagramPacket; import lombok.Getter; -import org.apache.logging.log4j.core.filter.Filterable; import org.fusesource.jansi.AnsiConsole; -import org.geysermc.api.ChatColor; import org.geysermc.api.Connector; -import org.geysermc.api.ConsoleColors; import org.geysermc.api.Geyser; import org.geysermc.api.command.CommandMap; import org.geysermc.api.logger.Logger; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java b/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java index de10204a..7dddfc2a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/Registry.java @@ -1,3 +1,28 @@ +/* + * 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.network.translators; import com.github.steveice10.packetlib.packet.Packet; @@ -25,5 +50,4 @@ public class Registry { System.err.println("could not translate packet" + p.getClass().getSimpleName()); } } - } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java index 7498c8a7..ca0b7f29 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java @@ -1,3 +1,28 @@ +/* + * 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.network.translators; import com.flowpowered.math.vector.Vector2f; diff --git a/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java b/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java index 4875b5a3..7cd71cd6 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java +++ b/connector/src/main/java/org/geysermc/connector/utils/Toolbox.java @@ -1,8 +1,31 @@ +/* + * 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.utils; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.type.CollectionType; import com.nukkitx.network.VarInts; import com.nukkitx.protocol.bedrock.v361.BedrockUtils; import io.netty.buffer.ByteBuf; @@ -10,18 +33,16 @@ import io.netty.buffer.Unpooled; import java.io.InputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; public class Toolbox { + static { - InputStream stream = Toolbox.class.getClassLoader().getResourceAsStream("cached_pallete.json"); - ObjectMapper mapper = new ObjectMapper(); - - ArrayList> entries = new ArrayList<>(); + List> entries = new ArrayList<>(); try { entries = mapper.readValue(stream, ArrayList.class); @@ -30,16 +51,13 @@ public class Toolbox { } ByteBuf b = Unpooled.buffer(); - VarInts.writeInt(b, entries.size()); - for (Map e : entries) { BedrockUtils.writeString(b, (String) e.get("name")); b.writeShortLE((Integer) e.get("data")); } CACHED_PALLETE = b; - } public static final ByteBuf CACHED_PALLETE; From e39c29866a7a4339f9577acbe9a81bd59887b4ff Mon Sep 17 00:00:00 2001 From: Redned Date: Wed, 17 Jul 2019 13:16:30 -0500 Subject: [PATCH 4/4] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 881f41af..61f61bd4 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,26 @@ The ultimate goal for this project is to allow those to join Minecraft: Java Edi If you're interested in development, please join our Discord server: https://discord.gg/mRjbCsS +## What's Completed +- [x] Server recognized in server list +- [x] Join detection from remote +- [ ] Online mode/auth support +- [ ] Chat/command support +- [ ] Inventory support +- [ ] Movement support +- [ ] Entity support +- [ ] Chunks +- [ ] Block break/place support + ## Compiling Clone the repo to your computer, and run `mvn clean install`. ## Contributing As a project that is still nowhere near completion, any contributions are appreciated. Please feel free to reach out to us on Discord if you're interested in helping this project come along. + +## Libraries Used: +- [NukkitX Bedrock Protocol Library](https://github.com/NukkitX/Protocol) +- [Steveice10's Java Protocol Library](https://github.com/Steveice10/MCProtocolLib) +- [TerminalConsoleAppender](https://github.com/Minecrell/TerminalConsoleAppender) +- [Simple Logging Facade for Java (slf4j)](https://github.com/qos-ch/slf4j)