-
Notifications
You must be signed in to change notification settings - Fork 0
Align repository with DPC conventions #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
4
commits into
master
Choose a base branch
from
copilot/align-repo-with-dpc-conventions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2a82a2a
Initial plan
Copilot e7613b1
Align repository with DPC conventions
Copilot 6a2b151
Address review comments: fix permission nodes, copilot-instructions, …
Copilot 70ca6b5
Change all permissions from wac.* to nac.* in plugin.yml, docs
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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` | ||
|
|
||
| ## 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.'` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.*, butsrc/main/resources/plugin.ymlcurrently declareswac.*permission nodes. This mismatch can cause confusing default permission behavior; align the documented permission nodes with what the plugin actually defines/enforces.