Skip to content

Commit

Permalink
#26 project structure in README, shrink jar
Browse files Browse the repository at this point in the history
  • Loading branch information
CubBossa committed Mar 10, 2023
1 parent 39498fe commit 72cdf54
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## What is it

Pathfinder is a plugin for minecraft servers, that allows administrators to setup graphs of waypoints and connecting edges. This roadmap can then be used to visualize shortest paths, discover points of interest and so on.
Pathfinder is a plugin for minecraft servers, that allows administrators to set up graphs of waypoints and connecting edges. This roadmap can then be used to visualize shortest paths, discover points of interest and more.

For more details check the [docs](https://docs.leonardbausenwein.de/getting_started/introduction.html).

Expand Down Expand Up @@ -41,3 +41,36 @@ dependencies {
<version>[VERSION]</version>
</dependency>
```


## Project Structure

### pathfinder-core

The main module that handles RoadMaps, Waypoints, Nodegroups and the according logic.
It is to be used as API for now. Interesting classes might be `NodeType`, `VisualizerType`, `PathVisualizer`
and the matching handlers `NodeTypeHandler` and `VisualizerHandler`. More information on using the
API will be added to the docs soon.

### pathfinder-graphs

The logic for path solving on graphs. It is a dependency of `pathfinder-core` and has to be
shaded into the core module, otherwise exceptions will occur.

### pathfinder-editmode

Adds an ingame editor for RoadMaps. It uses clientside armorstands and particles to display
waypoints and edges and requires [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/).
It is not necessary to shade `pathfinder-editmode` into core. The module registeres itself to core
as a service once it is shaded. If it is not, the ingame command `/roadmap editmode <roadmap>` will not work.

You can also use your own editmode visualizer by implementing the RoadMapEditor interface
and registering a RoadMapEditorFactory service class.

### pathfinder-scripted-visualizer

Adds a pathvisualizer to the core module that uses javascript to define particle behaviour.
Particles can be shifted by using complex math expressions. The visualizer requires a heavy
script engine service to be shaded into the jar. Therefore, it is a separate module that is again
not necessary for core to function. It implements the PathPluginExtension Service interface and
registers the VisualizerType implementation to the VisualizerHandler from core.
9 changes: 9 additions & 0 deletions pathfinder-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies {
// Configuration
api("de.cubbossa:NBO-Core:1.0")
api("com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0")
runtimeOnly("org.snakeyaml:snakeyaml-engine:2.3")

// Commands
api("de.cubbossa:commandapi-shade:8.7.5")
Expand Down Expand Up @@ -181,7 +182,13 @@ tasks {
}
shadowJar {


// "whitelist" approach, only include transitive dependencies that are truly necessary.
// otherwise jar grows from ~8mb to ~30mb
dependencies {
include(project(":pathfinder-graph"))
include(project(":pathfinder-editmode"))
include(project(":pathfinder-scripted-visualizer"))
include(dependency("net.kyori:.*"))
include(dependency("org.bstats:bstats-bukkit:.*"))
include(dependency("de.cubbossa:MenuFramework:.*"))
Expand All @@ -198,6 +205,8 @@ tasks {
include(dependency("de.tr7zw:item-nbt-api-plugin:.*"))
include(dependency("org.antlr:antlr4-runtime:.*"))
include(dependency("com.github.Exlll.ConfigLib:configlib-yaml:.*"))
include(dependency("com.github.Exlll.ConfigLib:configlib-core:.*"))
include(dependency("org.snakeyaml:snakeyaml-engine:.*"))
include(dependency("org.jooq:jooq:.*"))
include(dependency("com.zaxxer:HikariCP:.*"))
}
Expand Down

0 comments on commit 72cdf54

Please sign in to comment.