Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Fix compiling the plugin (#32)
* fix compiling the plugin part 1 * fix plugin compile part 2
Dieser Commit ist enthalten in:
Ursprung
77c8acefdb
Commit
c52177af9f
@ -9,4 +9,37 @@
|
||||
<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>
|
@ -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);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
24
pom.xml
24
pom.xml
@ -19,6 +19,30 @@
|
||||
<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>
|
||||
<url>https://github.com/GeyserMC/Geyser/blob/master/pom.xml</url>
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren