Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoobes committed Mar 13, 2024
1 parent c5ba1b7 commit dc089fc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: leviem1
github: jacoobes
191 changes: 38 additions & 153 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,166 +1,51 @@
# PaperMC/Spigot Minecraft Server Plugin Template
A template for building PaperMC/Spigot Minecraft server plugins!

[![Build, Test, and Release](https://github.com/CrimsonWarpedcraft/plugin-template/actions/workflows/main.yml/badge.svg)](https://github.com/CrimsonWarpedcraft/plugin-template/actions/workflows/main.yml)

## Features
### Github Actions 🎬
* Automated builds, testing, and release drafting

### Bots 🤖
* **Probot: Stale**
* Mark issues stale after 30 days
* **Dependabot**
* Update GitHub Actions workflows
* Update Gradle dependencies

### Issue Templates 📋
* Bug report template
* Feature request template

### Gradle Builds 🏗
* Shadowed [PaperLib](https://github.com/PaperMC/PaperLib) build
* [Checkstyle](https://checkstyle.org/) Google standard style check
* [SpotBugs](https://spotbugs.github.io/) code analysis
* [JUnit](https://junit.org/) testing

### Config Files 📁
* Sample plugin.yml with autofill name, version, and main class.
* Empty config.yml (just to make life \*that\* much easier)
* Gradle build config
* Simple .gitignore for common Gradle files

## Usage
In order to use this template for yourself, there are a few things that you will need to keep in mind.

### Release Info
Stable versions of this repo are tagged `vX.Y.Z` and have an associated [release](https://github.com/CrimsonWarpedcraft/plugin-template/releases).

Testing versions of this repo are tagged `vX.Y.Z-RC-N` and have an associated [pre-release](https://github.com/CrimsonWarpedcraft/plugin-template/releases).

Development versions of this repo are pushed to the master branch and are **not** tagged.

#### Release and Versioning Strategy
| Event | Version Format | CI Action | GitHub Release Draft? |
|-------------------|----------------------|----------------------------------|-----------------------|
| PR | yyMMdd-HHmm-SNAPSHOT | Build and test | No |
| Schedule | yyMMdd-HHmm-SNAPSHOT | Build, test, and notify | No |
| Push to `main` | 0.0.0-SNAPSHOT | Build, test, release, and notify | No |
| Tag `vX.Y.Z-RC-N` | X.Y.Z-SNAPSHOT | Build, test, release, and notify | Pre-release |
| Tag `vX.Y.Z` | X.Y.Z | Build, test, release, and notify | Release |



Add any required repositories for your dependencies in the following section.

```groovy
repositories {
maven {
name 'papermc'
url 'https://papermc.io/repo/repository/maven-public/'
content {
includeModule("io.papermc.paper", "paper-api")
includeModule("io.papermc", "paperlib")
includeModule("net.md-5", "bungeecord-chat")
}
}
mavenCentral()
}
# ScratchPaper
## A Minecraft plugin with a Math DSL
```

Also, update your dependencies as needed (of course).

```groovy
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.3'
implementation 'io.papermc:paperlib:1.0.8'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.3'
testImplementation 'io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}
fn slope(m,x,b) = m*x+b;
slope(1,5,2);
```

### src/main/resources/plugin.yml
First, update the following with your information.

```yaml
author: AUTHOR
description: DESCRIPTION
```
## Features
- Add, subtract, multiply, divide numbers in the minecraft commandline.
- Create simple functions to remove redundant routines.
- Bind native functions
- sin,cos,min,max, and more!
- PR's needed to add more.

Next, the `commands` and `permissions` sections below should be updated as needed.

```yaml
commands:
ex:
description: Base command for EXAMPLE
usage: "For a list of commands, type /ex help"
aliases: example
permissions:
example.test:
description: DESCRIPTION
default: true
example.*:
description: Grants all other permissions
default: false
children:
example.test: true
## [Syntax](./src/main/antlr/Expr.g4) :
### Program
A program consists of zero or more functions and an optional expression.
If no expression exists, **0 is the result**.
### Functions
```

### .github/dependabot.yml
You will need to replace all instances of `leviem1`, such as the one below, with your GitHub
username.

```yaml
reviewers:
- "leviem1"
fn ident(id, id1, id2) = expr
```

### .github/CODEOWNERS
You will need to replace `leviem1`, with your GitHub username.

```text
* @leviem1
```

### .github/FUNDING.yml
Update or delete this file, whatever applies to you.

```yaml
github: leviem1
fn ident() = expr
```

For more information see: [Displaying a sponsor button in your repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository)

### CODE_OF_CONDUCT.md
If you chose to adopt a Code of Conduct for your project, please update line 63 with your preferred
contact method.

## Creating a Release
Below are the steps you should follow to create a release.

1. Create a tag on `main` using semantic versioning (e.g. v0.1.0)
2. Push the tag and get some coffee while the workflows run
3. Publish the release draft once it's been automatically created

## Building locally
Thanks to [Gradle](https://gradle.org/), building locally is easy no matter what platform you're on. Simply run the following command:

```text
./gradlew build
### Expressions
Basically, any math calculator
```js
1 + 2 - 5
```
### Function calls
``` js
sin(rad(0))
```
- yields `.49999`

This build step will also run all checks and tests, making sure your code is clean.

JARs can be found in `build/libs/`.
### Constants
Built in constants are `PI`, `E`, `CHUNK`
- A CHUNK is 16 ( in minecraft )

## Developing
- This is a gradle project, and two main scripts exist
- I use intellij to simplify the workflow.
- I don't know how to use anything else for java applications
- generateGrammarSource
- build
## Contributing
See [CONTRIBUTING.md](https://github.com/CrimsonWarpedcraft/plugin-template/blob/main/CONTRIBUTING.md).

---

I think that's all... phew! Oh, and update this README! ;)
- [Read this](./CONTRIBUTING.md)
- Open a pull request.
- I'll review it!
2 changes: 1 addition & 1 deletion src/main/antlr/Expr.g4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
grammar Expr;
prog: def* expr*;
prog: def* expr?;
expr
: expr op=('*'|'/') expr #opexpr
| expr op=('+'|'-') expr #opexpr
Expand Down

0 comments on commit dc089fc

Please sign in to comment.