Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9ac575b
feat: Introduce friend management features with backend integration a…
TheBjoRedCraft Feb 25, 2026
f47ade4
feat: Update friendship management API and adjust plugin dependencies
TheBjoRedCraft Feb 25, 2026
863a4aa
feat: Refactor FriendPlayerService and FriendService to use requiredS…
TheBjoRedCraft Feb 25, 2026
52a7b1e
feat: Update version to 1.21.11-3.0.0-SNAPSHOT and upgrade Kotlin ver…
TheBjoRedCraft Feb 25, 2026
ae0d525
chore: delete idea files
TheBjoRedCraft Feb 25, 2026
8dd74f1
feat: Implement database loader and friend management tables with ser…
TheBjoRedCraft Feb 25, 2026
3c1d453
feat: Update FriendRequestsTable and FriendShipsTable to use UUIDs fo…
TheBjoRedCraft Feb 25, 2026
ffeb6ff
feat: Add FriendRequestRepository for managing friend request data
TheBjoRedCraft Feb 25, 2026
261a54f
feat: Add FriendPlayerRepository and FriendShipRepository for managin…
TheBjoRedCraft Feb 25, 2026
7815ee5
feat: Add savePlayer function to FriendPlayerRepository for persistin…
TheBjoRedCraft Feb 25, 2026
1c9af05
feat: Add texture field to FriendPlayer and implement save functions …
TheBjoRedCraft Feb 25, 2026
a738d5d
feat: Implement FriendPlayerService and FriendRequestService interfac…
TheBjoRedCraft Feb 25, 2026
1af26c2
feat: Implement FriendRequestService and FriendShipService with repos…
TheBjoRedCraft Feb 25, 2026
8a33b1c
feat: Add surf-friends-paper module to project settings
TheBjoRedCraft Feb 25, 2026
3b36af0
feat: Add Paper plugin integration and player connection handling
TheBjoRedCraft Feb 25, 2026
b433ea5
feat: Add friend command and permission registry for surf friends int…
TheBjoRedCraft Feb 25, 2026
9e86008
feat: Integrate Redis for player caching and enhance friend command f…
TheBjoRedCraft Feb 26, 2026
2eeb694
feat: Refactor player cache handling in FriendPlayerServiceImpl
TheBjoRedCraft Feb 26, 2026
4721c7a
feat: Add offline friend argument and refactor package structure for …
TheBjoRedCraft Feb 26, 2026
22219b4
feat: Implement friend player utility and enhance friend command func…
TheBjoRedCraft Feb 26, 2026
9fd8df1
feat: Enhance friend request functionality with sender and receiver n…
TheBjoRedCraft Feb 26, 2026
76922f8
feat: Implement friend request sending and friendship removal functio…
TheBjoRedCraft Feb 26, 2026
7afd2f8
feat: Add pagination for friend lists and enhance Friendship model wi…
TheBjoRedCraft Feb 26, 2026
8fab2a1
feat: Add friend list and request pagination with empty state handling
TheBjoRedCraft Feb 26, 2026
8f816ac
feat: Add functionality to view sent and received friend requests wit…
TheBjoRedCraft Feb 26, 2026
c51f35d
feat: Add custom arguments for handling received and sent friend requ…
TheBjoRedCraft Feb 26, 2026
0c4510a
feat: Implement accept, decline, and revoke functionalities for frien…
TheBjoRedCraft Feb 26, 2026
b69ba87
feat: Enhance player connection listener with online friend count and…
TheBjoRedCraft Feb 26, 2026
68e9a8e
feat: Add conditional notifications for online friends and pending re…
TheBjoRedCraft Feb 26, 2026
8132fc3
feat: Update friend request and friendship services to manage player …
TheBjoRedCraft Feb 26, 2026
0f271e3
feat: Update .gitignore to exclude the entire .idea directory
TheBjoRedCraft Feb 26, 2026
5ed7057
feat: Refactor friend player caching and database interactions
TheBjoRedCraft Feb 26, 2026
67a2e59
feat: Prevent players from adding themselves as friends with an error…
TheBjoRedCraft Feb 26, 2026
5fcf0d7
feat: Prevent players from sending multiple friend requests to the sa…
TheBjoRedCraft Feb 26, 2026
d85234d
feat: Implement friend request handling and notifications with Redis …
TheBjoRedCraft Feb 27, 2026
fdfb93f
feat: Enhance friend player argument handling to return real friend n…
TheBjoRedCraft Feb 27, 2026
e83e50c
feat: Update friend name retrieval to use getOtherName method for acc…
TheBjoRedCraft Feb 27, 2026
6b32265
feat: Add friend list and add commands with online status display
TheBjoRedCraft Feb 27, 2026
1474640
feat: Implement friend request notifications and player loading enhan…
TheBjoRedCraft Feb 27, 2026
930766b
feat: Improve friend request argument handling with null safety and e…
TheBjoRedCraft Mar 6, 2026
42886c7
feat: Sort friend list by online status in descending order
TheBjoRedCraft Mar 6, 2026
edd9a33
feat: Replace insert with upsert for player data in FriendPlayerRepos…
TheBjoRedCraft Mar 6, 2026
baa7b6e
feat: Update friend notification setting to default to enabled
TheBjoRedCraft Mar 6, 2026
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build/
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
.idea
*.iws
*.iml
*.ipr
Expand Down
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions .idea/compiler.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copilot.data.migration.agent.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copilot.data.migration.ask2agent.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copilot.data.migration.edit.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/discord.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/gradle.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/kotlinc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/material_theme_project_new.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kotlin.code.style=official
kotlin.stdlib.default.dependency=false
org.gradle.parallel=true
version=1.21.11-2.0.2-SNAPSHOT
version=1.21.11-3.0.0-SNAPSHOT
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-9.4.
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ plugins {
}
include("surf-friends-api")
include("surf-friends-core")
include("surf-friends-velocity")
include("surf-friends-fallback")
include("surf-friends-backend")
include("surf-friends-paper")
6 changes: 5 additions & 1 deletion surf-friends-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("dev.slne.surf.surfapi.gradle.core")
id("dev.slne.surf.surfapi.gradle.paper-raw")
}

surfRawPaperApi {
withCorePaper()
}
Original file line number Diff line number Diff line change
@@ -1,107 +1,9 @@
package dev.slne.surf.friends.api

import dev.slne.surf.friends.api.model.FriendRequest
import dev.slne.surf.friends.api.model.Friendship
import it.unimi.dsi.fastutil.objects.ObjectSet
import java.util.UUID
import dev.slne.surf.surfapi.core.api.util.requiredService

interface SurfFriendsApi {
/**
* Creates a friendship between two users.
*
* @param uuid The UUID of the first user.
* @param friend The UUID of the friend.
* @return The created Friendship object.
*/
suspend fun createFriendship(uuid: UUID, friend: UUID): Friendship

/**
* Removes a friendship between two users.
*
* @param uuid The UUID of the first user.
* @param friend The UUID of the friend.
*/
suspend fun removeFriendship(uuid: UUID, friend: UUID)

/**
* Retrieves all friendships of a user.
*
* @param uuid The UUID of the user.
* @return A set of Friendships representing the user's friends.
*/
suspend fun getFriendships(uuid: UUID): ObjectSet<Friendship>

/**
* Sends a friend request from one user to another.
*
* @param sender The UUID of the sender.
* @param receiver The UUID of the receiver.
* @return The created FriendRequest object.
*/
suspend fun sendFriendRequest(sender: UUID, receiver: UUID): FriendRequest

/**
* Accepts a friend request.
*
* @param sender The UUID of the sender of the request.
* @param receiver The UUID of the receiver of the request.
*/
suspend fun acceptFriendRequest(sender: UUID, receiver: UUID)

/**
* Declines a friend request.
*
* @param sender The UUID of the sender of the request.
* @param receiver The UUID of the receiver of the request.
*/
suspend fun declineFriendRequest(sender: UUID, receiver: UUID)
val surfFriendsApi = requiredService<SurfFriendsApi>()

/**
* Revokes a sent friend request.
*
* @param sender The UUID of the sender of the request.
* @param receiver The UUID of the receiver of the request.
*/
suspend fun revokeFriendRequest(sender: UUID, receiver: UUID)

/**
* Retrieves all sent friend requests of a user.
*
* @param uuid The UUID of the user.
* @return A set of FriendRequests representing the recipients of the sent requests.
*/
suspend fun getSentFriendRequests(uuid: UUID): ObjectSet<FriendRequest>

/**
* Retrieves all received friend requests of a user.
*
* @param uuid The UUID of the user.
* @return A set of FriendRequests representing the senders of the received requests.
*/
suspend fun getReceivedFriendRequests(uuid: UUID): ObjectSet<FriendRequest>

/**
* Toggles announcements for a user.
*
* @param uuid The UUID of the user.
* @return The new status of announcements (true if enabled, false if disabled).
*/
suspend fun toggleAnnouncements(uuid: UUID): Boolean

/**
* Toggles sounds for a user.
*
* @param uuid The UUID of the user.
* @return The new status of sounds (true if enabled, false if disabled).
*/
suspend fun toggleSounds(uuid: UUID): Boolean
interface SurfFriendsApi {

/**
* Checks if two users are friends and retrieves their friendship details.
*
* @param uuid The UUID of the first user.
* @param friend The UUID of the second user.
* @return The Friendship object representing the friendship between the two users, or null if they are not friends.
*/
suspend fun areFriends(uuid: UUID, friend: UUID): Friendship?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dev.slne.surf.friends.api.friend

import dev.slne.surf.surfapi.core.api.serializer.java.datetime.datetime.offset.SerializableOffsetDateTime
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import java.time.OffsetDateTime
import java.util.*


fun friendRequest(
senderUuid: UUID,
receiverUuid: UUID,
senderName: String,
receiverName: String
) = FriendRequest(senderUuid, receiverUuid, senderName, receiverName, OffsetDateTime.now())

@Serializable
data class FriendRequest(
val senderUuid: @Contextual UUID,
val receiverUuid: @Contextual UUID,

val senderName: String,
val receiverName: String,

val sentAt: SerializableOffsetDateTime
)
Loading