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
69 changes: 47 additions & 22 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,59 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package
name: Build

on:
push:
branches: ['**']
pull_request:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v4

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

- name: Build and test
run: mvn -B clean package --file pom.xml

- name: Upload plugin jar
uses: actions/upload-artifact@v4
with:
name: story-plugin
path: target/story-plugin-*.jar
if-no-files-found: error

publish:
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

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

- name: Build release jar
run: mvn -B clean package --file pom.xml

- name: Attach jar to release
uses: softprops/action-gh-release@v2
with:
files: target/story-plugin-*.jar
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Maven
target/
dependency-reduced-pom.xml
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

# Gradle
.gradle/
build/

# IDE - IntelliJ
.idea/
*.iml
*.ipr
*.iws
out/

# IDE - Eclipse
.classpath
.project
.settings/
bin/

# IDE - VS Code
.vscode/

# OS
.DS_Store
Thumbs.db

# Logs
*.log

# Local Minecraft test server artifacts
run/
server/
plugins/
world/
world_nether/
world_the_end/
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mmmm Story Plugin

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/Rethinger/plugin)
[![Build](https://github.com/Rethinger/plugin/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/Rethinger/plugin/actions/workflows/maven-publish.yml)
[![Version](https://img.shields.io/badge/version-1.0-blue.svg)](https://github.com/Rethinger/plugin/releases)
[![Java](https://img.shields.io/badge/java-21+-orange.svg)](https://openjdk.java.net/)
[![PaperMC](https://img.shields.io/badge/PaperMC-1.21.1-green.svg)](https://papermc.io/)
Expand All @@ -23,9 +23,9 @@ A sophisticated Minecraft story campaign plugin built for PaperMC 1.21.x, featur
- **Manager-Based Architecture** - Clean separation of concerns across 13 specialized managers
- **Event-Driven Design** - Complex event listeners for each story act with precise timing
- **Configuration-Driven** - All story content externalized in YAML files
- **Performance Optimized** - Particle effects with radius optimization, mob throttling, and async data saving
- **Persistent Data Storage** - JSON-based player progress with 5-minute auto-save intervals
- **Memory Management** - Proper task cleanup and NPC memory management
- **Performance Optimized** - Particle effects with radius optimization, mob throttling, and off-thread autosave writes
- **Persistent Data Storage** - YAML player progress with 5-minute auto-save intervals
- **Memory Management** - Boss bars and NPCs released on shutdown, player profiles evicted on quit
- **Debug Tools** - Comprehensive debugging commands and detailed logging

### User Experience
Expand All @@ -43,7 +43,7 @@ A sophisticated Minecraft story campaign plugin built for PaperMC 1.21.x, featur
- **Maven 3.6+** (for building from source)

### Included Dependencies
- **NpcApi-Paper 1.21.x-4** - Advanced NPC functionality (bundled)
- **NpcApi-Paper 1.21.x-4** - Advanced NPC functionality (resolved from JitPack, shaded and relocated into the plugin jar)

## Installation

Expand Down Expand Up @@ -121,7 +121,7 @@ The plugin uses a sophisticated manager-based architecture with clear separation

#### Core Managers
1. **ConfigManager** - Configuration hub with multi-language support
2. **DataManager** - JSON-based player progress persistence
2. **DataManager** - YAML player progress persistence
3. **NPCManager** - Advanced NPC animations and behavioral AI
4. **DialogManager** - Interactive story system with sound synchronization
5. **ActManager** - Story progression and world state control
Expand Down
104 changes: 67 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<properties>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<paper.version>1.21.1-R0.1-SNAPSHOT</paper.version>
<npcapi.version>1.21.x-4</npcapi.version>
<junit.version>5.10.2</junit.version>
<mockito.version>5.11.0</mockito.version>
</properties>

<repositories>
Expand All @@ -23,68 +27,49 @@
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<!-- Spigot -->
<!-- JitPack - hosts de.eisi05:NpcApi-Paper -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<!-- Paper API -->
<!-- Paper API (also provides the Bukkit API used by the tests) -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<version>${paper.version}</version>
<scope>provided</scope>
</dependency>

<!-- Paper Server (for NMS access) -->
<dependency>
<groupId>dev.folia</groupId>
<artifactId>folia-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- NPC API Paper -->

<!-- NPC API Paper - shaded into the final jar -->
<dependency>
<groupId>de.eisi05</groupId>
<artifactId>NpcApi-Paper</artifactId>
<version>1.21.x-4</version>
<version>${npcapi.version}</version>
<scope>compile</scope>
</dependency>

<!-- Test Dependencies -->
<!-- JUnit Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<!-- Mockito -->

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.5.0</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<!-- Mockito JUnit Jupiter Integration -->

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.5.0</version>
<scope>test</scope>
</dependency>

<!-- Spigot API for testing -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.3-R0.1-SNAPSHOT</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -94,30 +79,75 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>21</source>
<target>21</target>
<release>${java.version}</release>
</configuration>
</plugin>

<!--
Pinned explicitly: Maven < 3.9 defaults to surefire 2.12.4, which
cannot run JUnit 5 and silently reports "no tests to run".
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<!--
Relocate the bundled NPC API so this plugin does not
clash with any other plugin shading the same library.
-->
<relocations>
<relocation>
<pattern>de.eisi05.npc</pattern>
<shadedPattern>com.mmmm.story.libs.eisi05.npc</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<!-- Only plugin.yml needs ${project.version} substitution. -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>plugin.yml</exclude>
</excludes>
</resource>
</resources>
</build>
Expand Down
38 changes: 0 additions & 38 deletions src/main/NpcApi-Paper-master/.github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

This file was deleted.

Loading
Loading