feat: Implement Javadocs tasks
This commit is contained in:
parent
1e7ae82bb7
commit
9737d0a449
@ -1,11 +1,34 @@
|
|||||||
|
plugins {
|
||||||
|
`maven-publish`
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("io.papermc.paper:paper-api:1.19.1-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:1.19.1-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
compileJava {
|
compileJava {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(17)
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
|
javadoc {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
publishing {
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("maven") {
|
||||||
|
groupId = project.group as String
|
||||||
|
artifactId = project.name
|
||||||
|
version = project.version as String
|
||||||
|
from(components["java"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,10 +7,18 @@ import org.bukkit.event.HandlerList;
|
|||||||
import org.bukkit.event.player.PlayerEvent;
|
import org.bukkit.event.player.PlayerEvent;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event executed before a player is sent to another server after being logged in
|
||||||
|
* <p>Here you have the possibility to cancel the player's sending
|
||||||
|
*/
|
||||||
public class PreSendLoginEvent extends PlayerEvent implements Cancellable {
|
public class PreSendLoginEvent extends PlayerEvent implements Cancellable {
|
||||||
private static final HandlerList HANDLERS = new HandlerList();
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
private boolean isCancelled = false;
|
private boolean isCancelled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new PreSendLoginEvent
|
||||||
|
* @param player the player to be sended
|
||||||
|
*/
|
||||||
public PreSendLoginEvent(@NotNull Player player) {
|
public PreSendLoginEvent(@NotNull Player player) {
|
||||||
super(player, !Bukkit.isPrimaryThread());
|
super(player, !Bukkit.isPrimaryThread());
|
||||||
}
|
}
|
||||||
@ -30,6 +38,10 @@ public class PreSendLoginEvent extends PlayerEvent implements Cancellable {
|
|||||||
return HANDLERS;
|
return HANDLERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the handlerlist of this event
|
||||||
|
* @return the handlerlist
|
||||||
|
*/
|
||||||
public static HandlerList getHandlerList() {
|
public static HandlerList getHandlerList() {
|
||||||
return HANDLERS;
|
return HANDLERS;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/**AuthMeVelocity Paper API Module */
|
||||||
|
@SuppressWarnings({"requires-automatic", "requires-transitive-automatic"})
|
||||||
module me.adrianed.authmevelocity.api.paper {
|
module me.adrianed.authmevelocity.api.paper {
|
||||||
requires static transitive org.bukkit;
|
requires static transitive org.bukkit;
|
||||||
requires static org.jetbrains.annotations;
|
requires static org.jetbrains.annotations;
|
||||||
|
@ -1,11 +1,39 @@
|
|||||||
|
plugins {
|
||||||
|
`maven-publish`
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.compileJava {
|
java {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
compileJava {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
|
||||||
options.release.set(17)
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
|
javadoc {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
(options as StandardJavadocDocletOptions).links(
|
||||||
|
"https://jd.adventure.kyori.net/api/4.10.0/",
|
||||||
|
"https://jd.adventure.kyori.net/text-minimessage/4.11.0/"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
publishing {
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("maven") {
|
||||||
|
groupId = project.group as String
|
||||||
|
artifactId = project.name
|
||||||
|
version = project.version as String
|
||||||
|
from(components["java"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
* Here you have the ability to deny the event.
|
* Here you have the ability to deny the event.
|
||||||
*/
|
*/
|
||||||
public final class PreSendOnLoginEvent implements ResultedEvent<ServerResult> {
|
public final class PreSendOnLoginEvent implements ResultedEvent<ServerResult> {
|
||||||
|
|
||||||
private ServerResult result;
|
private ServerResult result;
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final RegisteredServer actualserver;
|
private final RegisteredServer actualserver;
|
||||||
@ -34,7 +33,7 @@ public final class PreSendOnLoginEvent implements ResultedEvent<ServerResult> {
|
|||||||
* Obtain the logged player
|
* Obtain the logged player
|
||||||
* @return the player
|
* @return the player
|
||||||
*/
|
*/
|
||||||
public @NotNull Player getPlayer(){
|
public @NotNull Player player(){
|
||||||
return this.player;
|
return this.player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ public final class PreSendOnLoginEvent implements ResultedEvent<ServerResult> {
|
|||||||
* Obtain the server on which the player is located
|
* Obtain the server on which the player is located
|
||||||
* @return the actual server of the player
|
* @return the actual server of the player
|
||||||
*/
|
*/
|
||||||
public @NotNull RegisteredServer getActualServer(){
|
public @NotNull RegisteredServer actualServer(){
|
||||||
return this.actualserver;
|
return this.actualserver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ public final class PreSendOnLoginEvent implements ResultedEvent<ServerResult> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the result of the event
|
* Set the result of the event
|
||||||
* @param newresult the new result
|
* @param newResult the new result
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setResult(@NotNull ServerResult newResult) {
|
public void setResult(@NotNull ServerResult newResult) {
|
||||||
|
@ -4,14 +4,5 @@ import com.velocitypowered.api.proxy.Player;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class ProxyForcedUnregisterEvent {
|
/**Event executed in case a player is forced unregister by a server operator*/
|
||||||
private final Player player;
|
public record ProxyForcedUnregisterEvent(@Nullable Player player) {}
|
||||||
|
|
||||||
public ProxyForcedUnregisterEvent(@Nullable Player player){
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @Nullable Player getPlayer(){
|
|
||||||
return this.player;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -7,14 +7,4 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
/**
|
/**
|
||||||
* Event executed in case the player is successfully logged in
|
* Event executed in case the player is successfully logged in
|
||||||
*/
|
*/
|
||||||
public final class ProxyLoginEvent {
|
public record ProxyLoginEvent(@NotNull Player player) {}
|
||||||
private final Player player;
|
|
||||||
|
|
||||||
public ProxyLoginEvent(@NotNull Player player){
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull Player getPlayer(){
|
|
||||||
return this.player;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -4,14 +4,5 @@ import com.velocitypowered.api.proxy.Player;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public final class ProxyLogoutEvent {
|
/**Event executed in case the player has logout from the network */
|
||||||
private final Player player;
|
public record ProxyLogoutEvent(@NotNull Player player) {}
|
||||||
|
|
||||||
public ProxyLogoutEvent(@NotNull Player player){
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull Player getPlayer(){
|
|
||||||
return this.player;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -4,14 +4,5 @@ import com.velocitypowered.api.proxy.Player;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public final class ProxyRegisterEvent {
|
/**Event executed in case the player has register itself*/
|
||||||
private final Player player;
|
public record ProxyRegisterEvent(@NotNull Player player) {}
|
||||||
|
|
||||||
public ProxyRegisterEvent(@NotNull Player player){
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull Player getPlayer(){
|
|
||||||
return this.player;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -4,14 +4,5 @@ import com.velocitypowered.api.proxy.Player;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class ProxyUnregisterEvent {
|
/**Event executed in case the player has unregister itself*/
|
||||||
private final Player player;
|
public record ProxyUnregisterEvent(@NotNull Player player) {}
|
||||||
|
|
||||||
public ProxyUnregisterEvent(@NotNull Player player){
|
|
||||||
this.player = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
public @NotNull Player getPlayer(){
|
|
||||||
return this.player;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -3,6 +3,7 @@ package me.adrianed.authmevelocity.api.velocity.event;
|
|||||||
import com.velocitypowered.api.event.ResultedEvent.Result;
|
import com.velocitypowered.api.event.ResultedEvent.Result;
|
||||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||||
|
|
||||||
|
/**A result that produces a resulting server */
|
||||||
public record ServerResult(boolean result, RegisteredServer server) implements Result {
|
public record ServerResult(boolean result, RegisteredServer server) implements Result {
|
||||||
private static final ServerResult DENIED = new ServerResult(false, null);
|
private static final ServerResult DENIED = new ServerResult(false, null);
|
||||||
|
|
||||||
@ -11,10 +12,20 @@ public record ServerResult(boolean result, RegisteredServer server) implements R
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allowed ServerResult
|
||||||
|
* @param server the resulted server
|
||||||
|
* @return A ServerResult with allowed result and custom server result
|
||||||
|
*/
|
||||||
public static final ServerResult allowed(RegisteredServer server) {
|
public static final ServerResult allowed(RegisteredServer server) {
|
||||||
return new ServerResult(true, server);
|
return new ServerResult(true, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Denied ServerResult
|
||||||
|
*
|
||||||
|
* @return A ServerResult with denied result and null server
|
||||||
|
*/
|
||||||
public static final ServerResult denied() {
|
public static final ServerResult denied() {
|
||||||
return DENIED;
|
return DENIED;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/**AuthMeVelocity Velocity API Module */
|
||||||
|
@SuppressWarnings({"requires-automatic", "requires-transitive-automatic"})
|
||||||
module me.adrianed.authmevelocity.api.velocity {
|
module me.adrianed.authmevelocity.api.velocity {
|
||||||
requires static transitive com.velocitypowered.api;
|
requires static transitive com.velocitypowered.api;
|
||||||
requires static org.jetbrains.annotations;
|
requires static org.jetbrains.annotations;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user