Skip to content

Commit e05f2f4

Browse files
author
Alexteens24
committed
feat: add CI and release workflows for automated builds and deployments
1 parent dc2b455 commit e05f2f4

4 files changed

Lines changed: 194 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-and-test:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Temurin JDK 21
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: '21'
29+
cache: maven
30+
31+
- name: Verify with Maven
32+
run: mvn -B -ntp verify
33+
34+
- name: Upload plugin artifact
35+
if: success()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: DynamicKeepInv-${{ github.sha }}
39+
path: target/DynamicKeepInv-*.jar
40+
if-no-files-found: error
41+
42+
- name: Upload test reports on failure
43+
if: failure()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: surefire-reports-${{ github.sha }}
47+
path: |
48+
target/surefire-reports/**
49+
target/*.log
50+
if-no-files-found: ignore

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Temurin JDK 21
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: '21'
24+
cache: maven
25+
26+
- name: Build release artifact
27+
run: mvn -B -ntp package
28+
29+
- name: Publish GitHub release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
files: target/DynamicKeepInv-*.jar
33+
generate_release_notes: true

README.md

Lines changed: 111 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
# DynamicKeepInv
22

3-
![Java](https://img.shields.io/badge/Java-21%2B-orange) ![Server](https://img.shields.io/badge/Server-Paper%20%7C%20Spigot%20%7C%20Folia-blue) ![License](https://img.shields.io/badge/License-Apache%202.0-green)
3+
![Java](https://img.shields.io/badge/Java-21%2B-orange) ![Server](https://img.shields.io/badge/Server-Paper%20%7C%20Spigot%20%7C%20Folia-blue) ![License](https://img.shields.io/badge/License-Apache%202.0-green) [![CI](https://github.com/Alexteens24/DynamicKeepInv/actions/workflows/ci.yml/badge.svg)](https://github.com/Alexteens24/DynamicKeepInv/actions/workflows/ci.yml)
44

5-
DynamicKeepInv makes `keepInventory` configurable instead of binary. You can decide whether players keep items and XP based on time of day, death cause, protection plugins, economy rules, and optional safety-net rules.
5+
DynamicKeepInv turns `keepInventory` from a simple on/off gamerule into a configurable rule engine.
6+
7+
Instead of choosing between fully safe or fully punishing deaths, you can decide whether players keep items and XP based on:
8+
9+
- day or night
10+
- PvP or PvE
11+
- claims, regions, or towns
12+
- economy rules
13+
- first-death leniency
14+
- repeated-death protection
615

716
Built for 1.20.4+ servers with Java 21 and full Folia support.
817

918
---
1019

20+
## Why Use It?
21+
22+
Vanilla `keepInventory` is too blunt for most servers.
23+
24+
DynamicKeepInv lets you build setups like:
25+
26+
- safe day, dangerous night
27+
- casual PvE, punishing PvP
28+
- keep items in your own land, lose them in enemy territory
29+
- pay to keep items through a death GUI
30+
- forgive a player's first death or a brutal death streak
31+
32+
---
33+
1134
## Highlights
1235

1336
- Day/night keep-inventory rules with separate item and XP control
@@ -23,6 +46,21 @@ Built for 1.20.4+ servers with Java 21 and full Folia support.
2346

2447
---
2548

49+
## Optional Integrations
50+
51+
| Plugin | What it adds |
52+
| :--- | :--- |
53+
| Vault | Economy-based keep-inventory modes |
54+
| PlaceholderAPI | Player/server placeholders |
55+
| Lands | Own-land / other-land / wilderness rules |
56+
| GriefPrevention | Own-claim / other-claim / wilderness rules |
57+
| WorldGuard | Own-region / other-region / wilderness rules |
58+
| Towny | Own-town / other-town / wilderness rules |
59+
| GravesX / AxGraves | Graves instead of normal drops |
60+
| MMOItems | Protected tag handling for soulbound-style items |
61+
62+
---
63+
2664
## Rule Order
2765

2866
When a player dies, the plugin evaluates rules in this order:
@@ -36,6 +74,8 @@ When a player dies, the plugin evaluates rules in this order:
3674

3775
The first rule that returns a result wins.
3876

77+
This means high-priority safety rules like bypass, first-death, and streak protection can override the final day/night fallback.
78+
3979
---
4080

4181
## Requirements
@@ -54,7 +94,7 @@ Optional plugins:
5494

5595
---
5696

57-
## Installation
97+
## Quick Start
5898

5999
1. Download the latest JAR from [Releases](https://github.com/Alexteens24/DynamicKeepInv/releases).
60100
2. Place it in your server's `plugins/` folder.
@@ -67,6 +107,17 @@ Config migration runs automatically on startup and reload.
67107

68108
---
69109

110+
## Default Behavior
111+
112+
Out of the box:
113+
114+
- day keeps items and XP
115+
- night drops items and XP
116+
- stats are enabled
117+
- optional integrations are disabled until you enable them in config
118+
119+
---
120+
70121
## Commands
71122

72123
| Command | Permission | Description |
@@ -88,7 +139,7 @@ Useful permissions:
88139

89140
---
90141

91-
## Config Example
142+
## Example Config
92143

93144
```yaml
94145
rules:
@@ -146,6 +197,55 @@ economy:
146197
147198
---
148199
200+
## Common Use Cases
201+
202+
### Safe Day, Dangerous Night
203+
204+
```yaml
205+
rules:
206+
day:
207+
keep-items: true
208+
keep-xp: true
209+
night:
210+
keep-items: false
211+
keep-xp: false
212+
```
213+
214+
### Keep Items On First Death
215+
216+
```yaml
217+
rules:
218+
first-death:
219+
enabled: true
220+
keep-items: true
221+
keep-xp: true
222+
```
223+
224+
### Pay To Keep Items
225+
226+
```yaml
227+
economy:
228+
enabled: true
229+
cost: 250.0
230+
mode: "gui"
231+
```
232+
233+
### Claimed Areas Are Safe, Wilderness Is Not
234+
235+
```yaml
236+
integrations:
237+
lands:
238+
enabled: true
239+
in-own-land:
240+
keep-items: true
241+
keep-xp: true
242+
in-other-land:
243+
keep-items: false
244+
keep-xp: false
245+
```
246+
247+
---
248+
149249
## Placeholders
150250
151251
Requires PlaceholderAPI.
@@ -161,7 +261,9 @@ See the wiki pages for full details.
161261

162262
---
163263

164-
## Wiki
264+
## Documentation
265+
266+
Full documentation lives in the wiki:
165267

166268
- [Home](wiki/Home.md)
167269
- [Installation](wiki/Installation.md)
@@ -172,6 +274,10 @@ See the wiki pages for full details.
172274
- [Stats](wiki/Stats.md)
173275
- [Placeholders](wiki/Placeholders.md)
174276

277+
GitHub Wiki:
278+
279+
- https://github.com/Alexteens24/DynamicKeepInv/wiki
280+
175281
---
176282

177283
## License

0 commit comments

Comments
 (0)