HomeJavaModsDearU

📬 DearU

A modern mailbox plugin for Paper/Folia servers

Kotlin Java Paper License

✨ Features

📁 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

Installation

  1. Build the plugin:

    ./gradlew build
    
  2. Find the JAR in core/build/libs/

  3. Place it in your server's plugins/ folder

  4. 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:

Configuration System

Nested class-based configuration using ConfigLib:

class Commands {
    val mailbox = createExtendedComplexField { CommandField("mailbox") }
}

🔧 Dependencies

Runtime Dependencies

Build Dependencies

📝 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


Made with ❤️ for the Minecraft community

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more