Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/currency-…
Browse files Browse the repository at this point in the history
…research

# Conflicts:
#	pom.xml
  • Loading branch information
StarWishsama committed Jan 5, 2024
2 parents 529138b + e339503 commit ae752b3
Show file tree
Hide file tree
Showing 58 changed files with 1,829 additions and 307 deletions.
1 change: 1 addition & 0 deletions .adr-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/adr
2 changes: 1 addition & 1 deletion .github/workflows/discord-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Java JDK 17
uses: actions/setup-java@v3.13.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
javaVersion: '18'
- mcVersion: '1.19.4'
javaVersion: '19'
- mcVersion: '1.20.1'
- mcVersion: 'latest'
javaVersion: '20'

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v4.0.0
with:
distribution: temurin
java-version: ${{ matrix.javaVersion }}
Expand All @@ -48,10 +48,16 @@ jobs:
- name: Download ${{ matrix.mcVersion }} Paper
run: |
VERSION="${{ matrix.mcVersion }}"
if [ "$VERSION" == "latest" ]; then
VERSION=$(curl https://api.papermc.io/v2/projects/paper/ -s | jq -r '.versions[-1]')
fi
BUILD_JAR=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds" \
| jq '.builds[-1] | "\(.build) \(.downloads.application.name)"' -r)
BUILD=$(echo "$BUILD_JAR" | awk '{print $1}')
JAR_FILE=$(echo "$BUILD_JAR" | awk '{print $2}')
echo "Downloading... https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE"
curl -o paper.jar \
"https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-compiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3.13.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Kinda jank way to grab the PR and commit hash and then download the artifact
# TODO: Move this code to our own mini-action
- name: Grab PR & run ID and download the artifact
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3.13.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3.13.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.settings/
/.idea/
/.vscode/
/data-store/

dependency-reduced-pom.xml

Expand Down
51 changes: 46 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Table of contents
- [Release Candidate 36 (TBD)](#release-candidate-36-tbd)
- [Release Candidate 35 (7 Jul 2023)](#release-candidate-35-7-jul-2023)
- [Release Candidate 37 (TBD)](#release-candidate-37-tbd)
- [Release Candidate 36 (20 Dec 2023)](#release-candidate-36-20-dec-2023)
- [Release Candidate 35 (07 Jul 2023)](#release-candidate-35-07-jul-2023)
- [Release Candidate 34 (20 Jun 2023)](#release-candidate-34-20-jun-2023)
- [Release Candidate 33 (07 Jan 2023)](#release-candidate-33-07-jan-2023)
- [Release Candidate 32 (26 Jun 2022)](#release-candidate-32-26-jun-2022)
Expand Down Expand Up @@ -36,15 +37,55 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## Release Candidate 36 (TBD)
## Release Candidate 37 (TBD)

## Release Candidate 36 (20 Dec 2023)

#### Additions
* Added e2e testing to PRs to better ensure compatibility
* Added compatibility to 1.20+
* Added rainbow armor
* Added grace periods to radiation
* Added cherry log to android woodcutter
* Added blackstone recipes to Grindstone and Ore Crusher (#3912)
* Added Enchanted Golden Apple recipe (suggestion #2147 from punished_Garett) (#3591)
* Added new flags for timings (#3246)
* Added yaw to GPS Waypoints
* (API) Add MultiBlockCraftEvent (#3928)
* (API) Add TalismanActivateEvent (#4045)

#### Changes
* Changed the radiation system
* Removed backwards compatibility
* (API) Improve performance for clearAllBlockInfoAtChunk
* Change Energized GPS Transmitter values to follow the pattern of previous tiers (#3915)
* Allowed the sword of beheading to drop piglin heads
* Improvements to BlockStorage handling (#3911)
* Moved builds to https://blob.build

#### Fixes

## Release Candidate 35 (7 Jul 2023)
* Fix #3444
* Fix #3507
* Fix possible enchantment duplication
* Fix Different Time of Pan Recipes
* Fix some of the reported blocks not working (#3848)
* Fix Soulbound Runes not working (#3932)
* Fix #3836
* Fix unable to craft soulbound backpack with woven backpack with id (#3939)
* Fix getting radiated when not supposed to
* Fix geo miner voiding resources
* Fix sensitive blocks attached to sf blocks not dropping (1.19+)
* Fix breaking sf block with not unlocked item duping contents (#3976)
* Fix the case of SlimefunItem#itemhandlers
* Fix taking damage on head collision while wearing elytra cap (#3760)
* Fix heads showing as steve (#4027)
* Fix grappling hook not working due to bat dying (#3926)
* Fix freezer material
* Fix auto update
* Fix rate limiting issues (#4042)
* Fix orebfuscator plugin with blocks when gold panning (#3921)

## Release Candidate 35 (07 Jul 2023)

#### Additions
* Added `sounds.yml` file to configure sound effects for Slimefun
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Here is a full summary of the differences between the two different versions of
| **Bug Reports** | :heavy_check_mark: | :x: |
| **testing before release** | :x: | :heavy_check_mark: |
| **change logs** | :x: | :memo: **[change log](https://github.com/Slimefun/Slimefun4/blob/master/CHANGELOG.md)** |
| **Download link** | :floppy_disk: **[download latest](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/master/)** | :floppy_disk: **[download "stable"](https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/)** |
| **Download links** | :floppy_disk: **[download latest](https://blob.build/project/Slimefun4/Dev)** | :floppy_disk: **[download "stable"](https://blob.build/project/Slimefun4/RC)** |

**:exclamation: We wholeheartedly recommend you to use _development builds_, they are the most recent version of Slimefun and also receive the most frequent updates! In fact, "stable" builds are so outdated that we won't accept bug reports from them at all.**
<details>
Expand Down
129 changes: 129 additions & 0 deletions docs/adr/0001-storage-layer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# 1. Storage layer

Date: 2023-11-15
Last update: 2023-12-27

**DO NOT rely on any APIs introduced until we finish the work completely!**

## Status

Work in progress

## Context

Slimefun has been around for a very long time and due to that, the way we
wrote persistence of data has also been around for a very long time.
While Slimefun has grown, the storage layer has never been adapted.
This means that even all these years later, it's using the same old saving/loading.
This isn't necessarily always bad, however, as Slimefun has grown both in terms of content
and the servers using it - we've seen some issues.

Today, files are saved as YAML files (sometimes with just a JSON object per line),
which is good for a config format but not good for a data store. It can create very large files
that can get corrupted, the way we've been saving data often means loading it all at once as well
rather than lazy-loading and generally isn't very performant.

For a long time we've been talking about rewriting our data storage in multiple forms
(you may have seen this referenced for "BlockStorage rewrite" or "SQL for PlayerProfiles", etc.).
Now is the time we start to do this, this will be a very large change and will not be done quickly or rushed.

This ADR talks about the future of our data persistence.

## Decision

We want to create a new storage layer abstraction and implementations
which will be backwards-compatible but open up new ways of storing data
within Slimefun. The end end goal is we can quickly and easily support
new storage backends (such as binary storage, SQL, etc.) for things like
[PlayerProfile](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java), [BlockStorage](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java), etc.

We also want to be generally more efficient in the way we save and load data.
Today, we load way more than is required.
We can improve memory usage by only loading what we need, when we need it.

We will do this incrementally and at first, in an experimental context.
In that regard, we should aim to minimise the blast radius and lift as much
as possible.

### Quick changes overview

* New abstraction over storage to easily support multiple backends.
* Work towards moving away from the legacy YAML based storage.
* Lazy load and save data to more efficiently handle the data life cycle.

### Implementation details

There is a new interface called [`Storage`](TBD) which is what all storage
backends will implement.
This will have methods for loading and saving things like
[`PlayerProfile`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java) and [`BlockStorage`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java).

Then, backends will implement these
(e.g. [`LegacyStorageBackend`](TBD) (today's YAML situation))
in order to support these functions.
Not all storage backends are required support each data type.
e.g. SQL may not support [`BlockStorage`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java).


## Addons

The goal is that Addons will be able to use and implement new storage backends
if they wish and also be extended so they can load/save things as they wish.

The first few iterations will not focus on Addon support. We want to ensure
this new storage layer will work and supports what we need it to today.

This ADR will be updated when we get to supporting Addons properly.

## Considerations

This will be a big change therefore we will be doing it as incrementally as
possible.
Changes will be tested while in the PR stage and merged into the Dev releases when possible.
We may do an experimental release if required.

Phases do not (and very likely will not) be done within a single PR. They will also not have any timeframe attached to them.

The current plan looks like this:

* Phase 1 - Implement legacy data backend for [`PlayerProfile`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java).
* We want to load player data using the new storage layer with the current
data system.
* We'll want to monitor for any possible issues and generally refine
how this system should look
* Phase 2 - Implement new experimental binary backend for [`PlayerProfile`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java).
* Create a new backend for binary storage
* Implement in an experimental capacity and allow users to opt-in
* Provide a warning that this is **experimental** and there will be bugs.
* Implement new metric for storage backend being used
* Phase 3 - Mark the new backend as stable for [`PlayerProfile`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/io/github/thebusybiscuit/slimefun4/api/player/PlayerProfile.java).
* Mark it as stable and remove the warnings once we're sure things are
working correctly
* Create a migration path for users currently using "legacy".
* Enable by default for new servers
* Phase 4 - Move [`BlockStorage`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java) to new storage layer.
* The big one! We're gonna tackle adding this to BlockStorage.
This will probably be a large change and we'll want to be as
careful as possible here.
* Implement `legacy` and `binary` as experimental storage backends
for BlockStorage and allow users to opt-in
* Provide a warning that this is **experimental** and there will be bugs.
* Phase 5 - Mark the new storage layer as stable for [`BlockStorage`](https://github.com/Slimefun/Slimefun4/blob/bbfb9734b9f549d7e82291eff041f9b666a61b63/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java).
* Mark it as stable and remove the warnings once we're sure things are
working correctly
* Ensure migration path works here too.
* Enable by default for new servers
* Phase 6 - Finish up and move anything else we want over
* Move over any other data stores we have to the new layer
* We should probably still do experimental -> stable but it should have
less of a lead time.

## State of work

* Phase 1: In progress
* https://github.com/Slimefun/Slimefun4/pull/4065
* Phase 2: Not started
* Phase 3: Not started
* Phase 4: Not started
* Phase 5: Not started
* Phase 6: Not started
11 changes: 11 additions & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ADR

An ADR (Architecture Decision Record) is a document describing large changes, why we made them, etc.

## Making a new ADR

If you're making a large change to Slimefun, we recommend creating an ADR
in order to document why this is being made and how it works for future contributors.

Please follow the general format of the former ADRs or use a tool
such as [`adr-tools`](https://github.com/npryce/adr-tools) to generate a new document.
Loading

0 comments on commit ae752b3

Please sign in to comment.