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
39 changes: 39 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copilot Instructions

This repository follows the DPC (Dans Plugins Community) conventions defined at
https://github.com/Dans-Plugins/dpc-conventions. Read those conventions before
making any changes.

## Technology Stack

- Language: Java
- Build tool: Maven
- Target platform: Spigot / Paper (Minecraft plugin)
- Minimum API version: 1.13

## Project Structure

- `src/main/java/` – Plugin source code
- `src/main/resources/` – `plugin.yml` and resource files
- `src/test/java/` – Unit tests (create this directory as needed)

### Key Packages

- `dansplugins.netheraccesscontroller` – Main plugin class
- `dansplugins.netheraccesscontroller.commands` – Command implementations
- `dansplugins.netheraccesscontroller.data` – Data models
- `dansplugins.netheraccesscontroller.listeners` – Event listeners
- `dansplugins.netheraccesscontroller.services` – Business logic services
- `dansplugins.netheraccesscontroller.utils` – Utility classes

## Coding Conventions

- Messages are currently hardcoded in Java; denial messages are configurable via `config.yml`.
- Follow the existing package structure when adding new classes.
- Annotate every command executor and event listener with `@Override` where applicable.

## Contribution Workflow

- Branch from `develop` for all changes.
- Open a pull request against `develop`, not `main`.
- Reference the related GitHub issue in every pull request description.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Maven
run: mvn clean package
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: [ created ]

permissions:
contents: write

jobs:
build-and-attach:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Build with Maven
run: mvn clean package

- name: Upload JAR to release
uses: softprops/action-gh-release@v2
with:
files: |
target/*.jar
!target/original-*.jar
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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/).

## [Unreleased]

## [1.1.0]

### Added

- Configuration commands (`/nac config show`, `/nac config set`)
- Customisable denial messages (`denyUsageMessage`, `denyCreationMessage`)
- Debug mode for troubleshooting event handling

## [1.0.0]

### Added

- Initial release
- Nether access whitelist system
- Portal creation prevention
- Portal usage prevention
- Commands: `/nac help`, `/nac allow`, `/nac deny`, `/nac list`
- bStats integration
55 changes: 55 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Commands Reference

All commands use the `/nac` base command.

## General Commands

### /nac

**Description:** Displays the plugin version and developer information.
**Permission:** None
**Usage:** `/nac`

### /nac help

**Description:** Lists all available commands.
**Permission:** `nac.help`
**Usage:** `/nac help`
Comment on lines +14 to +17
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

The permissions referenced here are nac.*, but src/main/resources/plugin.yml currently declares wac.* permission nodes. This mismatch can cause confusing default permission behavior; align the documented permission nodes with what the plugin actually defines/enforces.

Copilot uses AI. Check for mistakes.

## Whitelist Commands

### /nac allow \<playerName\>

**Description:** Adds a player to the nether access whitelist, allowing them to create and use nether portals.
**Permission:** `nac.allow`
**Usage:** `/nac allow <playerName>`
**Example:** `/nac allow Steve`

### /nac deny \<playerName\>

**Description:** Removes a player from the nether access whitelist, preventing them from creating and using nether portals.
**Permission:** `nac.deny`
**Usage:** `/nac deny <playerName>`
**Example:** `/nac deny Steve`

### /nac list

**Description:** Displays all players currently on the nether access whitelist.
**Permission:** `nac.list`
**Usage:** `/nac list`

## Configuration Commands

### /nac config show

**Description:** Displays all current configuration settings and their values.
**Permission:** `nac.config`
**Usage:** `/nac config show`

### /nac config set \<option\> \<value\>

**Description:** Sets a configuration option to the specified value. Use single quotes around values that contain spaces.
**Permission:** `nac.config`
**Usage:** `/nac config set <option> <value>`
**Example:** `/nac config set preventPortalUsage true`
**Example:** `/nac config set denyUsageMessage 'You cannot enter the nether.'`
63 changes: 63 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Configuration Guide

Configuration can be modified in-game using `/nac config set <option> <value>` or by editing `plugins/NetherAccessController/config.yml` directly.

## debugMode

**Type:** boolean
**Default:** `false`
**Description:** Enables debug logging to the server console when portal and interaction events fire. Useful for troubleshooting.

**Example:**

```yaml
debugMode: false
```

## preventPortalUsage

**Type:** boolean
**Default:** `false`
**Description:** When enabled, prevents players who are not on the whitelist from using existing nether portals. If disabled, only portal creation is controlled.

**Example:**

```yaml
preventPortalUsage: false
```

## preventPortalCreation

**Type:** boolean
**Default:** `true`
**Description:** When enabled, prevents players who are not on the whitelist from creating nether portals with flint and steel on obsidian.

**Example:**

```yaml
preventPortalCreation: true
```

## denyUsageMessage

**Type:** string
**Default:** `"You're unable to use nether portals."`
**Description:** The message sent to players when they are denied access to a nether portal. Only applies when `preventPortalUsage` is enabled.

**Example:**

```yaml
denyUsageMessage: "You're unable to use nether portals."
```

## denyCreationMessage

**Type:** string
**Default:** `"You're unable to create nether portals."`
**Description:** The message sent to players when they are denied the ability to create a nether portal. Only applies when `preventPortalCreation` is enabled.

**Example:**

```yaml
denyCreationMessage: "You're unable to create nether portals."
```
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Contributing

## Thank You

Thank you for your interest in contributing to Nether Access Controller! 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>/Nether-Access-Controller.git`
4. Open the project in your IDE.
5. Build the plugin: `mvn clean package`
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/Nether-Access-Controller/issues).

### Milestones

Issues are grouped into [milestones](https://github.com/Dans-Plugins/Nether-Access-Controller/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.

## Testing

Run the build with:

Linux / macOS:

mvn clean package

Windows:

mvn clean package

For manual testing, place the built JAR from `target/` into a local Spigot server's `plugins` folder and restart the server.

## Questions

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