Compatibility
Minecraft: Java Edition
1.21.x
Platforms
Links
Tags
Creators
Details
⨠Features
- š® Mailbox System - Players can receive and manage their mail through a beautiful GUI
- š¦ Package Support - Send single items or multi-item packages to players
- š¾ Database Abstraction - Built-in support for SQLite and MySQL
- ā” Async Operations - Non-blocking mail operations using
CompletableFuture - šØ Modern API - Clean Java interface for plugin developers
- š ļø Command Aliases - Customizable command aliases
š Project Structure
DearU/
āāā api/ # Java module with public interfaces
ā āāā DearU # Main plugin interface
ā āāā Mailbox # Async mailbox operations
ā āāā Mail # Sealed interface for mail types
ā ā āāā SingleMail # Single item mail
ā ā āāā PackageMail # Multi-item package
ā āāā MailSender # Mail sender representation
ā āāā MailboxManager # Mailbox instance manager
ā
āāā core/ # Kotlin module with implementations
āāā DearUPlugin # Main plugin class
āāā DearUConfiguration # Config system
āāā DatabaseManager # Database abstraction
āāā MailboxManagerImpl # Mailbox implementation
āāā MailboxGui # GUI implementation
š Getting Started
Requirements
- Java 21 or higher
- Paper/Folia server (latest version)
Installation
-
Build the plugin:
./gradlew build -
Find the JAR in
core/build/libs/ -
Place it in your server's
plugins/folder -
Restart your server
Configuration
Edit plugins/DearU/config.yml to customize:
# Database settings (SQLite/MySQL)
database:
sql:
type: SQLITE # or MYSQL
mysql:
host: localhost
port: 3306
database: dearu
username: root
password: password
# Command aliases
commands:
mailbox:
aliases:
- mail
- ģ°ķøķØ
š» Development
Build Commands
# Build the project
./gradlew build
# Run test server (Paper)
./gradlew runServer
# Run Folia test server
./gradlew runFolia
# Clean build artifacts
./gradlew clean
API Usage
Sending Mail
import com.bindglam.dearu.DearU;
import com.bindglam.dearu.mail.*;
// Get plugin instance
DearU dearU = DearUProvider.get();
// Send single item mail
Mail singleMail = Mail.single(
MailSender.server(),
itemStack,
"Welcome to our server!"
);
dearu.mailboxManager().getMailbox(playerUUID)
.putMail(singleMail);
// Send package mail
PackageMail.Body body = PackageMail.bodyBuilder()
.name("Welcome Package")
.content(itemStack1)
.content(itemStack2)
.build();
Mail packageMail = Mail.packaged(
MailSender.player(senderUUID),
body,
"Here's your starter kit!"
);
dearu.mailboxManager().getMailbox(playerUUID)
.putMail(packageMail);
Reading Mail
import com.bindglam.dearu.Mailbox;
import java.util.concurrent.CompletableFuture;
Mailbox mailbox = dearU.mailboxManager().getMailbox(playerUUID);
// Get all mail (async)
CompletableFuture<List<Mailbox.IdentifiedMail>> future = mailbox.mails();
future.thenAccept(mails -> {
for (Mailbox.IdentifiedMail identified : mails) {
Mail mail = identified.mail();
// Process mail...
}
});
// Get specific mail by ID
CompletableFuture<Mailbox.IdentifiedMail> mailFuture = mailbox.mail(mailId);
mailFuture.thenAccept(identified -> {
if (identified != null) {
Mail mail = identified.mail();
// Process mail...
}
});
šļø Architecture
Managerial Pattern
All managers implement the Managerial interface:
interface Managerial {
fun start(context: Context)
fun end(context: Context)
}
Managers are initialized in plugin lifecycle:
val managers = listOf(DatabaseManager, MailboxManagerImpl)
managers.forEach { it.start(Context(this, dearUConfig)) }
Database Abstraction
Uses DatabaseLib for unified SQL operations:
- SQLite - Default, uses
database.dbin plugin data folder - MySQL - Configurable for production use
Configuration System
Nested class-based configuration using ConfigLib:
class Commands {
val mailbox = createExtendedComplexField { CommandField("mailbox") }
}
š§ Dependencies
Runtime Dependencies
- ConfigLib (1.0.0) - Configuration system
- DatabaseLib (1.0.4) - Database abstraction
- semver4j (6.0.0) - Version comparison
Build Dependencies
- Shadow Plugin - JAR shading and relocation
- RunPaper - Test server management
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
š Support
- š Report bugs via GitHub Issues
- š” Feature requests welcome
- š Check the code documentation for more details
Made with ā¤ļø for the Minecraft community

