3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-04 23:30:17 +01:00

Fix compiling the plugin (#32)

* fix compiling the plugin part 1

* fix plugin compile part 2
Dieser Commit ist enthalten in:
WesleyVanNeck 2019-09-14 17:28:29 +02:00 committet von Redned
Ursprung 77c8acefdb
Commit c52177af9f
3 geänderte Dateien mit 86 neuen und 24 gelöschten Zeilen

Datei anzeigen

@ -1,12 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>plugin</artifactId>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>plugin</artifactId>
<repositories>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.whirvis</groupId>
<artifactId>jraknet</artifactId>
<version>2.11.8</version>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -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<ConnectedPlayer> 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<ConnectedPlayer> players;
@SuppressWarnings("unchecked")
@Override
public void onEnable() {
try {
Class<? extends ProxyServer> clazz = getProxy().getClass();
Field field = clazz.getDeclaredField("connections");
field.setAccessible(true);
players = (List<ConnectedPlayer>) 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);
}*/
}
}

26
pom.xml
Datei anzeigen

@ -18,6 +18,30 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.14-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.whirvis</groupId>
<artifactId>jraknet</artifactId>
<version>2.11.8</version>
</dependency>
</dependencies>
<organization>
<name>GeyserMC</name>
@ -112,4 +136,4 @@
</plugin>
</plugins>
</build>
</project>
</project>