2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-04-08 16:10:26 +00:00

setup velocity, ValioBungee api

This commit is contained in:
2026-04-02 11:50:33 +04:00
parent 81491398e9
commit c6a45e6b0c
18 changed files with 403 additions and 33 deletions

View File

@@ -1,20 +1,5 @@
description = "Api functions for valiobungee"
plugins {
alias(libs.plugins.blossom)
alias(libs.plugins.indragit)
}
sourceSets {
main {
blossom {
javaSources {
property("apiversion", project.property("api-version").toString())
}
}
}
}
java {
withJavadocJar()

View File

@@ -15,4 +15,4 @@
*/
package net.limework.valiobungee.api;
public interface NetworkPlayer {}
public interface ValioBungeeAPI {}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2026 ValioBungee contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.limework.valiobungee.api;
/**
* this class provides the API object and access to the version and git commit
*
* @since 1.0.0
*/
public interface ValioBungeeAPIProvider {
/**
* @return The api object {@link ValioBungeeAPI}
*/
ValioBungeeAPI getAPI();
/**
* @return version of the build
*/
String getVersion();
/**
* @return GIT COMMIT based on the build
*/
String getGitCommit();
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2026 ValioBungee contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.limework.valiobungee.api.entity;
import java.util.UUID;
/**
* Network player.
*
* @author Ham1255
* @since 1.0.0
*/
public interface NetworkPlayer {
/**
* @return player unique id
*/
UUID getUUID();
/**
* @return proxy player on
*/
NetworkProxy getProxy();
}

View File

@@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.limework.valiobungee.api;
package net.limework.valiobungee.api.entity;
import java.util.Set;
/**
* Proxy is an object for online proxy in a network
@@ -30,7 +32,12 @@ public interface NetworkProxy {
/**
* @return online players number in this proxy
*/
int onlinePlayers();
int onlinePlayersCount();
/**
* @return Returns set of players in this proxy
*/
Set<NetworkPlayer> networkPlayers();
/**
* @return returns true if this object is proxy on it

View File

@@ -0,0 +1,49 @@
plugins {
`java-library`
`maven-publish`
}
dependencies {
compileOnly(libs.platform.velocity)
api(project(":valiobungee-api"))
}
description = "ValioBungee Velocity API"
java {
withJavadocJar()
withSourcesJar()
}
tasks {
withType<Javadoc> {
dependsOn(project(":valiobungee-api").getTasksByName("javadoc", false))
val options = options as StandardJavadocDocletOptions
options.use()
options.isDocFilesSubDirs = true
options.links(
"https://jd.papermc.io/velocity/3.5.0/", // velocity api
)
val apiDocs = File(rootProject.projectDir, "api/build/docs/javadoc")
//options.linksOffline("https://ci.limework.net/ValioBungee/api/build/docs/javadoc", apiDocs.path)
}
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21) // required by velocity
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}

View File

@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.limework.valiobungee.api;
package net.limework.valiobungee.velocity.api;
public class APIConstantVariables {
import net.limework.valiobungee.api.ValioBungeeAPI;
public static final String API_VERSION = "{{ apiversion }}";
}
public interface VelocityValioBungeeAPI extends ValioBungeeAPI {}