Skip to content
Merged
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
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.0]

### Added

- Discord webhook notifications for player join events
- Configurable join-message templates with `{player}` and `{server}` placeholders
- Email (SMTP) notifications for player join events
- Configurable server name for notification messages
- Docker Compose setup for local mail-server testing
- Discord webhook test scripts (Bash and Python)
5 changes: 5 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Commands Reference

Herald does not register any player or console commands. All behaviour is controlled through the `config.yml` configuration file.

See the [Configuration Guide](CONFIG.md) for details on how to configure the plugin.
158 changes: 158 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Configuration Guide

All options are set in `plugins/Herald/config.yml`. The file is generated with sensible defaults on first run.

Options are listed in the same order they appear in the default configuration file.

## server-name

**Type:** string
**Default:** `""`
**Description:** The server name used in notification messages. Replaces the `{server}` placeholder in Discord join messages and in email notifications. If left empty, defaults to `"Minecraft"`.

**Example:**

```yaml
server-name: "My Awesome Server"
```

## discord.enabled

**Type:** boolean
**Default:** `false`
**Description:** Whether Discord webhook notifications are enabled.

**Example:**

```yaml
discord:
enabled: true
```

## discord.webhook-url

**Type:** string
**Default:** `""`
**Description:** The Discord webhook URL for the channel where join notifications should be sent. Required when `discord.enabled` is `true`.

**Example:**

```yaml
discord:
webhook-url: "https://discord.com/api/webhooks/123456/abcdef"
```

## discord.join-messages

**Type:** list of strings
**Default:** 10 medieval-themed messages (see below)
**Description:** A list of message templates picked at random when a player joins. Supports `{player}` and `{server}` placeholders. If the list is empty or absent, Herald falls back to built-in defaults.

**Default messages:**

```yaml
discord:
join-messages:
- "⚔️ Hear ye, hear ye! **{player}** hath entered the realm of **{server}**! ⚔️"
- "🏰 The gates of **{server}** open wide for **{player}**! Welcome, brave soul!"
- "📜 By royal decree, **{player}** hath been granted passage into **{server}**!"
- "🗡️ A new champion approaches! **{player}** rides into **{server}**!"
- "🌟 The bards shall sing of this day! **{player}** hath arrived in **{server}**!"
- "👑 All hail **{player}**, who now graces the lands of **{server}**!"
- "🔥 The torches flicker as **{player}** strides into **{server}**!"
- "🎺 Sound the trumpets! **{player}** hath joined the kingdom of **{server}**!"
- "🛡️ The defenders of **{server}** welcome **{player}** to their ranks!"
- "✨ By the stars above, **{player}** hath made their presence known in **{server}**!"
```

## email-recipients

**Type:** list of strings
**Default:** `[]`
**Description:** List of email addresses that will receive a notification when a player joins. Both this and `smtp.server` must be configured for email notifications to be active.

**Example:**

```yaml
email-recipients:
- "admin@example.com"
- "owner@example.com"
```

## smtp.server

**Type:** string
**Default:** `""`
**Description:** The hostname or IP address of your SMTP server.

**Example:**

```yaml
smtp:
server: "smtp.example.com"
```

## smtp.port

**Type:** integer
**Default:** `587`
**Description:** The port of your SMTP server. Use `587` for TLS (STARTTLS) or `25` for plain SMTP.

**Example:**

```yaml
smtp:
port: 587
```

## smtp.username

**Type:** string
**Default:** `""`
**Description:** The username for SMTP authentication. Leave empty if your server does not require authentication.

**Example:**

```yaml
smtp:
username: "user@example.com"
```

## smtp.password

**Type:** string
**Default:** `""`
**Description:** The password for SMTP authentication. Leave empty if your server does not require authentication.

**Example:**

```yaml
smtp:
password: "secret"
```

## smtp.use-tls

**Type:** boolean
**Default:** `true`
**Description:** Whether to use STARTTLS when connecting to the SMTP server. Set to `true` when using port `587`.

**Example:**

```yaml
smtp:
use-tls: true
```

## email.sender

**Type:** string
**Default:** `""`
**Description:** The email address that appears as the sender of notification emails.

**Example:**

```yaml
email:
sender: "herald@example.com"
```
67 changes: 67 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing

## Thank You

Thank you for your interest in contributing to Herald! This guide will help you get started.

## Links

- [Website](https://dansplugins.com)
- [Discord](https://discord.gg/xXtuAQ2)

## Requirements

- A GitHub account
- Git installed on your local machine
- A Java IDE or text editor
- A basic understanding of Java

## Getting Started

1. [Sign up for GitHub](https://github.com/signup) if you don't have an account.
2. Fork the repository by clicking **Fork** at the top right of the repo page.
3. Clone your fork: `git clone https://github.com/<your-username>/Herald.git`
4. Open the project in your IDE.
5. Build the plugin: `./gradlew build`
If you encounter errors, please open an issue.

## Identifying What to Work On

### Issues

Work items are tracked as [GitHub issues](https://github.com/Dans-Plugins/Herald/issues).

### Milestones

Issues are grouped into [milestones](https://github.com/Dans-Plugins/Herald/milestones) representing upcoming releases.

## Making Changes

1. Make sure an issue exists for the work. If not, create one.
2. Switch to `develop`: `git checkout develop`
3. Create a branch: `git checkout -b <branch-name>`
4. Make your changes.
5. Test your changes.
6. Commit: `git commit -m "Description of changes"`
7. Push: `git push origin <branch-name>`
8. Open a pull request against `develop`, link the related issue with `#<number>`.
9. Address review feedback.

### Language Files

Update `src/main/resources/lang/` for any user-facing string changes.

## Testing

Run the unit tests with:

Linux: `./gradlew clean test`
Windows: `.\gradlew.bat clean test`

For manual testing, start a local Spigot server:

docker compose up

## Questions

Ask in the [Discord server](https://discord.gg/xXtuAQ2).
Loading
Loading