Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ object Versions {
const val MULTIFICATION = "1.2.4"

const val JETBRAINS_ANNOTATIONS = "26.0.2-1"
const val JSPECIFY = "1.0.0"
const val PLACEHOLDER_API = "2.11.7"
const val DYNMAP_API = "3.7-beta-6"
const val LOMBOK = "1.18.42"
Expand Down
1 change: 1 addition & 0 deletions eternalcore-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ plugins {
dependencies {
compileOnly("org.spigotmc:spigot-api:${Versions.SPIGOT_API}")
api("org.jetbrains:annotations:${Versions.JETBRAINS_ANNOTATIONS}")
api("org.jspecify:jspecify:${Versions.JSPECIFY}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.Collection;
import java.util.UUID;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NonNull;

/**
* Service responsible for managing admin chat functionality.
Expand All @@ -20,15 +20,15 @@ public interface AdminChatService {
* @param playerUuid the UUID of the player to toggle admin chat for
* @return {@code true} if persistent chat was enabled, {@code false} if it was disabled
*/
boolean toggleChat(@NotNull UUID playerUuid);
boolean toggleChat(@NonNull UUID playerUuid);

/**
* Checks if the persistent admin chat mode is enabled for the specified player.
*
* @param playerUuid the UUID of the player to check
* @return {@code true} if persistent chat is enabled, {@code false} otherwise
*/
boolean hasEnabledChat(@NotNull UUID playerUuid);
boolean hasEnabledChat(@NonNull UUID playerUuid);

/**
* Retrieves all players who currently have persistent admin chat enabled.
Expand All @@ -39,7 +39,7 @@ public interface AdminChatService {
*
* @return an unmodifiable collection of player UUIDs with enabled admin chat
*/
@NotNull
@NonNull
@Unmodifiable
Collection<UUID> getPlayersWithEnabledChat();

Expand All @@ -52,27 +52,27 @@ public interface AdminChatService {
* @param message the message content to send
* @param sender the command sender who is sending the message
*/
void sendAdminChatMessage(@NotNull String message, @NotNull CommandSender sender);
void sendAdminChatMessage(@NonNull String message, @NonNull CommandSender sender);

/**
* Enables persistent admin chat for the specified player.
*
* @param playerUuid the UUID of the player
*/
void enableChat(@NotNull UUID playerUuid);
void enableChat(@NonNull UUID playerUuid);

/**
* Disables persistent admin chat for the specified player.
*
* @param playerUuid the UUID of the player
*/
void disableChat(@NotNull UUID playerUuid);
void disableChat(@NonNull UUID playerUuid);

/**
* Checks if the specified command sender has permission to see admin chat messages.
*
* @param sender the command sender to check
* @return {@code true} if the sender can see admin chat messages, {@code false} otherwise
*/
boolean canSeeAdminChat(@NotNull CommandSender sender);
boolean canSeeAdminChat(@NonNull CommandSender sender);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* Event called when an admin chat message is being sent.
Expand All @@ -21,7 +21,7 @@ public class AdminChatEvent extends Event implements Cancellable {
private String content;
private boolean cancelled;

public AdminChatEvent(@NotNull CommandSender sender, @NotNull String content) {
public AdminChatEvent(@NonNull CommandSender sender, @NonNull String content) {
super(false);

if (sender == null) {
Expand All @@ -36,22 +36,22 @@ public AdminChatEvent(@NotNull CommandSender sender, @NotNull String content) {
this.cancelled = false;
}

@NotNull
@NonNull
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}

@NotNull
@NonNull
public CommandSender getSender() {
return this.sender;
}

@NotNull
@NonNull
public String getContent() {
return this.content;
}

public void setContent(@NotNull String content) {
public void setContent(@NonNull String content) {
if (content == null) {
throw new IllegalArgumentException("Content cannot be null");
}
Expand All @@ -69,7 +69,7 @@ public void setCancelled(boolean cancelled) {
}

@Override
@NotNull
@NonNull
public HandlerList getHandlers() {
return HANDLER_LIST;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jspecify.annotations.NonNull;

/**
* Called when a player switches their afk status.
Expand Down Expand Up @@ -41,7 +42,7 @@ public void setCancelled(boolean cancel) {
}

@Override
public HandlerList getHandlers() {
public @NonNull HandlerList getHandlers() {
return HANDLER_LIST;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.eternalcode.core.feature.catboy;

import org.bukkit.entity.Cat;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Unmodifiable;

import java.util.Collection;
import java.util.Optional;
import java.util.UUID;
import org.bukkit.entity.Cat;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Unmodifiable;

/**
* Service for managing catboys.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.eternalcode.core.feature.home;

import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.Nullable;

public interface HomeService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* This event is called when a player wants to ignore all players.
Expand Down Expand Up @@ -38,7 +38,7 @@ public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}

@NotNull
@NonNull
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* This event is called when a player wants to ignore another player.
Expand Down Expand Up @@ -48,7 +48,7 @@ public void setCancelled(boolean cancel) {
}

@Override
public @NotNull HandlerList getHandlers() {
public @NonNull HandlerList getHandlers() {
return HANDLER_LIST;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* This event is called when a player ignores all other players.
Expand Down Expand Up @@ -38,7 +38,7 @@ public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}

@NotNull
@NonNull
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* This event is called when a player unignores another player.
Expand Down Expand Up @@ -47,7 +47,7 @@ public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}

@NotNull
@NonNull
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import java.time.Duration;
import java.util.Collection;
import java.util.Optional;
import java.util.UUID;
import org.bukkit.Location;

import java.util.Optional;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Blocking;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.Nullable;

public interface JailService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

public class DisableVanishEvent extends AbstractVanishEvent {

Expand All @@ -13,7 +13,7 @@ public DisableVanishEvent(Player player) {
}

@Override
public @NotNull HandlerList getHandlers() {
public @NonNull HandlerList getHandlers() {
return HANDLERS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

public class EnableVanishEvent extends AbstractVanishEvent {

Expand All @@ -13,7 +13,7 @@ public EnableVanishEvent(Player player) {
}

@Override
public @NotNull HandlerList getHandlers() {
public @NonNull HandlerList getHandlers() {
return HANDLERS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Called before teleportation to warp.
Expand Down
3 changes: 2 additions & 1 deletion eternalcore-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
api(project(":eternalcore-docs-api"))

// Base libraries
compileOnly("org.jspecify:jspecify:${Versions.JSPECIFY}")
compileOnly("org.jetbrains:annotations:${Versions.JETBRAINS_ANNOTATIONS}")

// Minecraft & Bridges API
Expand Down Expand Up @@ -111,7 +112,7 @@ eternalShadow {

// caffeine
library("com.github.ben-manes.caffeine:caffeine:${Versions.CAFFEINE}")
libraryRelocate("com.github.benmanes.caffeine");
libraryRelocate("com.github.benmanes.caffeine")

// glowingentites (nms)
library("fr.skytasul:glowingentities:${Versions.GLOWING_ENTITIES}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import com.eternalcode.core.bridge.BridgeInitializer;
import com.eternalcode.core.placeholder.PlaceholderRaw;
import com.eternalcode.core.placeholder.PlaceholderRegistry;
import java.util.Optional;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;

public class PlaceholderApiExtension extends PlaceholderExpansion implements BridgeInitializer {

Expand All @@ -22,7 +21,7 @@ public PlaceholderApiExtension(PlaceholderRegistry placeholderRegistry, PluginDe
}

@Override
public @Nullable String onPlaceholderRequest(Player player, @NotNull String params) {
public @NonNull String onPlaceholderRequest(Player player, @NonNull String params) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public @NonNull String onPlaceholderRequest(Player player, @NonNull String params) {
public @Nullable String onPlaceholderRequest(@NonNull Player player, @NonNull String params) {

Optional<PlaceholderRaw> optional = this.placeholderRegistry.getRawPlaceholder(params);

if (optional.isPresent()) {
Expand All @@ -33,17 +32,17 @@ public PlaceholderApiExtension(PlaceholderRegistry placeholderRegistry, PluginDe
}

@Override
public @NotNull String getIdentifier() {
public @NonNull String getIdentifier() {
return "eternalcore";
}

@Override
public @NotNull String getAuthor() {
public @NonNull String getAuthor() {
return "EternalCodeTeam";
}

@Override
public @NotNull String getVersion() {
public @NonNull String getVersion() {
return this.pluginDescriptionFile.getVersion();
}

Expand Down
Loading