Initial commit

This commit is contained in:
zimzaza4
2023-09-10 13:40:49 +08:00
commit d8c3feaacf
28 changed files with 1222 additions and 0 deletions

103
velocity/pom.xml Normal file
View File

@@ -0,0 +1,103 @@
<?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>
<groupId>me.zimzaza4</groupId>
<artifactId>geyserutils-velocity</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>geyserutils-velocity</name>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>filter-src</id>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
<dependencies>
<dependency>
<groupId>net.trajano.wagon</groupId>
<artifactId>wagon-git</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.9.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
<scmCommentPrefix xml:space="preserve">[RELEASE] </scmCommentPrefix>
<goals>install deploy site-deploy
</goals> <!-- install is here to fix javadoc generation in multi-module projects -->
<releaseProfiles>release</releaseProfiles>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.zimzaza4</groupId>
<artifactId>geyserutils-common</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,33 @@
package me.zimzaza4.geyserutils.velocity;
import com.google.inject.Inject;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import me.zimzaza4.geyserutils.common.channel.GeyserUtilsChannels;
import org.slf4j.Logger;
import java.nio.file.Path;
@Plugin(id = "geyserutils",
name = "GeyserUtils",
version = "1.0.0",
description = "nooo",
authors = {"zimzaza4"}
)
public class GeyserUtils {
private final ProxyServer server;
@Inject
public GeyserUtils(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory) {
this.server = server;
}
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
server.getChannelRegistrar().register(MinecraftChannelIdentifier.from(GeyserUtilsChannels.MAIN));
}
}