From c52177af9f3c74bab8721415eb0aba1a586a0b3f Mon Sep 17 00:00:00 2001 From: WesleyVanNeck Date: Sat, 14 Sep 2019 17:28:29 +0200 Subject: [PATCH] Fix compiling the plugin (#32) * fix compiling the plugin part 1 * fix plugin compile part 2 --- plugin/pom.xml | 57 +++++++++++++++---- .../org/geysermc/plugin/GeyserPlugin.java | 27 +++++---- pom.xml | 26 ++++++++- 3 files changed, 86 insertions(+), 24 deletions(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index bb5febc4..ebc94f79 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -1,12 +1,45 @@ - - - 4.0.0 - - org.geysermc - geyser-parent - 1.0-SNAPSHOT - - plugin - \ No newline at end of file + + + 4.0.0 + + org.geysermc + geyser-parent + 1.0-SNAPSHOT + + plugin + + + + bungeecord-repo + https://oss.sonatype.org/content/repositories/snapshots + + + codemc-repo + https://repo.codemc.org/repository/maven-public/ + + + + + + net.md-5 + bungeecord-api + 1.14-SNAPSHOT + jar + provided + + + net.md-5 + bungeecord-api + 1.14-SNAPSHOT + javadoc + provided + + + com.whirvis + jraknet + 2.11.8 + + + diff --git a/plugin/src/main/java/org/geysermc/plugin/GeyserPlugin.java b/plugin/src/main/java/org/geysermc/plugin/GeyserPlugin.java index 34df2c2d..27d8e59d 100644 --- a/plugin/src/main/java/org/geysermc/plugin/GeyserPlugin.java +++ b/plugin/src/main/java/org/geysermc/plugin/GeyserPlugin.java @@ -1,42 +1,47 @@ package org.geysermc.plugin; +import com.whirvis.jraknet.RakNetPacket; +import com.whirvis.jraknet.peer.RakNetClientPeer; +import com.whirvis.jraknet.server.RakNetServer; +import com.whirvis.jraknet.server.RakNetServerListener; +import net.md_5.bungee.api.ProxyServer; +import net.md_5.bungee.api.connection.ConnectedPlayer; +import net.md_5.bungee.api.plugin.Plugin; -public class GeyserPlugin { - /*private List players; +import java.lang.reflect.Field; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +public class GeyserPlugin extends Plugin { + private List players; @SuppressWarnings("unchecked") @Override public void onEnable() { try { Class clazz = getProxy().getClass(); - Field field = clazz.getDeclaredField("connections"); - field.setAccessible(true); - players = (List) field.get(getProxy()); } catch (Exception e) { throw new RuntimeException(e); } RakNetServer server = new RakNetServer(new InetSocketAddress("0.0.0.0", 65500), 1000000); - server.addListener(new RakNetServerListener() { @Override public void handleMessage(RakNetServer server, RakNetClientPeer peer, RakNetPacket packet, int channel) { if(packet.getId() == 0) { - } } }); } - private UUID fromXUID(String XUID) { String one = XUID.substring(0, XUID.length()/2); String two = XUID.substring(XUID.length()/2, XUID.length()); - long L1 = Long.parseLong(one); long L2 = Long.parseLong(two); - return new UUID(L1, L2); - }*/ + } } diff --git a/pom.xml b/pom.xml index 4cf58cdf..25a93324 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,30 @@ 1.8 1.8 + + + + net.md-5 + bungeecord-api + 1.14-SNAPSHOT + jar + provided + + + net.md-5 + bungeecord-api + 1.14-SNAPSHOT + javadoc + provided + + + com.whirvis + jraknet + 2.11.8 + + + + GeyserMC @@ -112,4 +136,4 @@ - \ No newline at end of file +