feat: initial commit
This commit is contained in:
57
.gitignore
vendored
Normal file
57
.gitignore
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/java,gradle
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
### Gradle ###
|
||||
.gradle
|
||||
**/build/
|
||||
!src/**/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Avoid ignore Gradle wrappper properties
|
||||
!gradle-wrapper.properties
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
# Eclipse Gradle plugin generated files
|
||||
# Eclipse Core
|
||||
.project
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
### Gradle Patch ###
|
||||
# Java heap dump
|
||||
*.hprof
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/java,gradle
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.leohabrom.velocity.customServerIcon;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
|
||||
import com.velocitypowered.api.plugin.Plugin;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
|
||||
@Plugin(id = "custom-server-icon", name = "Custom Server Icon", version = "1.0-SNAPSHOT",
|
||||
url = "https://", description = "I did it!", authors = {"Me"})
|
||||
public class CustomServerIcon {
|
||||
|
||||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@Subscribe
|
||||
public void onProxyInitialization(ProxyInitializeEvent event) {
|
||||
System.out.println("Hello from Custom Server Icon");
|
||||
// Plugin initialization logic goes here
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProxyPing(ProxyPingEvent event) {
|
||||
InetSocketAddress address = event.getConnection().getVirtualHost().orElse(null);
|
||||
if (address != null) {
|
||||
System.out.println(address.getHostName());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user