Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
e611fe3
Add tests for new 1.21 registries
firebl0od Sep 7, 2025
920c1f7
Add Armadillo scutes and cap 1.21 support
firebl0od Sep 7, 2025
2a9a26a
Merge pull request #1 from firebl0od/codex/mettre-a-jour-le-plugin-po…
firebl0od Sep 7, 2025
6c8bbc8
Expose 1.21 particles
firebl0od Sep 7, 2025
d4fabb5
feat: support crafter in cargo network
firebl0od Sep 7, 2025
a4eca0e
feat: support wind charge entity
firebl0od Sep 7, 2025
0999eb6
feat: add creaking entity type
firebl0od Sep 7, 2025
f2b0db8
Add 1.21 particle compatibility
firebl0od Sep 7, 2025
3d11a6f
Merge pull request #3 from firebl0od/codex/update-slimefun-for-spigot…
firebl0od Sep 7, 2025
8ff099f
Merge pull request #4 from firebl0od/codex/update-slimefun-for-spigot…
firebl0od Sep 7, 2025
aa51f25
Merge branch 'master' into codex/update-slimefun-for-spigot-1.21.7-a4…
firebl0od Sep 7, 2025
df5552d
Merge pull request #5 from firebl0od/codex/update-slimefun-for-spigot…
firebl0od Sep 7, 2025
8037655
Merge pull request #6 from firebl0od/codex/update-slimefun-for-spigot…
firebl0od Sep 7, 2025
42fb1e6
Merge branch 'master' into codex/mettre-a-jour-le-plugin-pour-minecra…
firebl0od Sep 7, 2025
d82c7a1
Merge pull request #2 from firebl0od/codex/mettre-a-jour-le-plugin-po…
firebl0od Sep 7, 2025
ff28dc2
Update for Spigot 1.21
firebl0od Sep 7, 2025
9d892df
Merge pull request #7 from firebl0od/codex/update-dependencies-and-co…
firebl0od Sep 7, 2025
91b6070
Integrate Crafter and Wolf Armor
firebl0od Sep 7, 2025
a7596ac
Add wolf armor recipe and expand medical cures
firebl0od Sep 7, 2025
95c4f39
Merge pull request #8 from firebl0od/codex/update-spigot-version-and-…
firebl0od Sep 7, 2025
be800bd
Merge branch 'master' into codex/update-spigot-version-and-dependenci…
firebl0od Sep 7, 2025
36af902
Merge pull request #9 from firebl0od/codex/update-spigot-version-and-…
firebl0od Sep 7, 2025
ef49833
Add recipes for new 1.21 blocks and armor
firebl0od Sep 7, 2025
afadee3
feat: enable brewing of new 1.21 potions
firebl0od Sep 7, 2025
8dc4dd3
Merge branch 'master' into codex/update-spigot-version-and-dependenci…
firebl0od Sep 7, 2025
ff6ce4e
Merge pull request #10 from firebl0od/codex/update-spigot-version-and…
firebl0od Sep 7, 2025
506bbbe
Merge branch 'master' into codex/update-spigot-version-and-dependenci…
firebl0od Sep 7, 2025
5180029
Merge pull request #11 from firebl0od/codex/update-spigot-version-and…
firebl0od Sep 7, 2025
7ef1060
Add proxy instructions for agents
firebl0od Sep 7, 2025
6792380
Merge branch 'master' into codex/update-spigot-version-and-dependenci…
firebl0od Sep 7, 2025
2d6d7ca
Merge pull request #12 from firebl0od/codex/update-spigot-version-and…
firebl0od Sep 7, 2025
2b1c659
build: add profile to skip mockbukkit tests
firebl0od Sep 7, 2025
1e4d605
Merge pull request #13 from firebl0od/codex/review-and-fix-all-merge-…
firebl0od Sep 7, 2025
1040832
feat: expand android drops for new mobs
firebl0od Sep 7, 2025
d4455cf
feat: add Breeze Rod mob drop
firebl0od Sep 7, 2025
375e74b
Merge pull request #14 from firebl0od/codex/continue-update-based-on-…
firebl0od Sep 7, 2025
575824a
Merge branch 'master' into codex/continue-update-based-on-integration…
firebl0od Sep 7, 2025
d0f11f7
Merge pull request #15 from firebl0od/codex/continue-update-based-on-…
firebl0od Sep 7, 2025
fd3e57e
docs: clean up 1.21 integration plan
firebl0od Sep 7, 2025
20c7dc0
feat: add armadillo scutes to butcher android drops
firebl0od Sep 7, 2025
8ec99d1
feat: add creaking drops
firebl0od Sep 7, 2025
9466e7b
Merge pull request #16 from firebl0od/codex/continue-update-based-on-…
firebl0od Sep 7, 2025
34beaf7
Merge branch 'master' into codex/continue-update-based-on-integration…
firebl0od Sep 7, 2025
8818fee
Merge pull request #17 from firebl0od/codex/continue-update-based-on-…
firebl0od Sep 7, 2025
fd5670c
Merge branch 'master' into codex/continue-update-based-on-integration…
firebl0od Sep 7, 2025
b90337f
Merge pull request #18 from firebl0od/codex/continue-update-based-on-…
firebl0od Sep 7, 2025
e7da3f3
Allow tuff variants in ore grinder
firebl0od Sep 7, 2025
3740f5e
Merge pull request #19 from firebl0od/codex/continue-update-from-inte…
firebl0od Sep 7, 2025
49bc257
Add Trial Chamber block recipes
firebl0od Sep 7, 2025
7d49053
Merge branch 'master' into codex/continue-update-from-integration-fil…
firebl0od Sep 7, 2025
40b875b
Merge pull request #20 from firebl0od/codex/continue-update-from-inte…
firebl0od Sep 7, 2025
d9b469c
Clarify Wolf Armor integration
firebl0od Sep 7, 2025
4b09382
Merge branch 'master' into codex/continue-update-from-integration-fil…
firebl0od Sep 7, 2025
f9bdb8a
Merge pull request #21 from firebl0od/codex/continue-update-from-inte…
firebl0od Sep 7, 2025
d8019f5
feat: add heavy core and mace recipes
firebl0od Sep 7, 2025
1824826
chore: update 1.21 integration
firebl0od Sep 7, 2025
7c6b2cd
test: cover AutoBrewer 1.21 potions
firebl0od Sep 7, 2025
3d12dc1
Register new 1.21 vanilla drops
firebl0od Sep 7, 2025
9815b3f
Merge pull request #22 from firebl0od/codex/expand-1.21-integration
firebl0od Sep 7, 2025
640dabd
Merge pull request #23 from firebl0od/codex/expand-1.21-integration-g…
firebl0od Sep 7, 2025
8f4d072
Merge pull request #24 from firebl0od/codex/expand-1.21-integration-x…
firebl0od Sep 7, 2025
6b20c2d
Merge branch 'master' into codex/expand-1.21-integration-g34i6e
firebl0od Sep 7, 2025
4eef8d1
Guard 1.21 items behind version checks
firebl0od Sep 7, 2025
181fb49
chore: update MockBukkit imports for 1.21.8
firebl0od Sep 7, 2025
d0a29c9
Merge pull request #25 from firebl0od/codex/expand-1.21-integration-g…
firebl0od Sep 7, 2025
bedae0e
Merge branch 'master' into codex/integrate-plugin-for-version-1.21.8
firebl0od Sep 7, 2025
577a691
Merge pull request #26 from firebl0od/codex/integrate-plugin-for-vers…
firebl0od Sep 7, 2025
90e28b1
Merge pull request #27 from firebl0od/codex/integrate-plugin-for-vers…
firebl0od Sep 7, 2025
0e5fee0
Use matchMaterial for 1.21 items
firebl0od Sep 7, 2025
3a683c5
fix: clean up 1.21 item registrations
firebl0od Sep 7, 2025
5725fe3
Merge pull request #28 from firebl0od/codex/continue-1.21.x-integration
firebl0od Sep 7, 2025
2593eb3
Merge branch 'master' into codex/continue-1.21.x-integration-llbsor
firebl0od Sep 7, 2025
4ed360a
Merge pull request #29 from firebl0od/codex/continue-1.21.x-integrati…
firebl0od Sep 7, 2025
057cbe0
feat: add versioned material registry
firebl0od Sep 7, 2025
eaf8cf1
Merge branch 'master' into codex/continue-1.21.x-integration-1xcap8
firebl0od Sep 7, 2025
000c93d
Merge pull request #30 from firebl0od/codex/continue-1.21.x-integrati…
firebl0od Sep 7, 2025
8c06aea
Finalize 1.21 integration
firebl0od Sep 7, 2025
ba255b3
Merge pull request #31 from firebl0od/codex/continue-1.21.x-integrati…
firebl0od Sep 7, 2025
e551b17
Fix SlimefunItemStack clone recursion
firebl0od Sep 7, 2025
19c35e1
Merge pull request #32 from firebl0od/codex/review-1.21-update-for-om…
firebl0od Sep 7, 2025
f41fce0
Allow early Slimefun bootstrap in tests
firebl0od Sep 7, 2025
254f819
Merge pull request #33 from firebl0od/codex/review-1.21-update-for-om…
firebl0od Sep 7, 2025
1a3bb31
Fix some tests and utilities
firebl0od Sep 7, 2025
bb71b9a
Merge pull request #34 from firebl0od/codex/run-tests-and-fix-issues
firebl0od Sep 7, 2025
a25aa37
Fix tests and compatibility utilities
firebl0od Sep 7, 2025
7f97179
Gracefully handle missing particles
firebl0od Sep 7, 2025
91894c9
Skip updater when plugin version mismatches
firebl0od Sep 7, 2025
5911f58
Merge pull request #35 from firebl0od/codex/run-tests-and-fix-issues-…
firebl0od Sep 7, 2025
2ac4260
Merge branch 'master' into codex/run-tests-and-fix-issues-k6j83i
firebl0od Sep 7, 2025
58fe228
Merge pull request #36 from firebl0od/codex/run-tests-and-fix-issues-…
firebl0od Sep 7, 2025
c7733c3
Improve updater configuration handling
firebl0od Sep 7, 2025
f3193f3
Parse build number without updater
firebl0od Sep 7, 2025
c06a2e0
Merge pull request #37 from firebl0od/codex/run-all-tests-and-consoli…
firebl0od Sep 7, 2025
31a8380
Merge pull request #38 from firebl0od/codex/run-all-tests-and-consoli…
firebl0od Sep 7, 2025
6074d06
Fix updater version initialization
firebl0od Sep 7, 2025
29b17d8
test: add crop coverage
firebl0od Sep 7, 2025
752e9c7
Merge pull request #39 from firebl0od/codex/run-all-tests-and-consoli…
firebl0od Sep 7, 2025
b2225ea
Merge pull request #40 from firebl0od/codex/run-all-tests-and-consoli…
firebl0od Sep 7, 2025
1a7e0fa
docs: add AI test fork changelog
firebl0od Sep 7, 2025
88aa15b
Merge pull request #41 from firebl0od/codex/summarize-closed-pull-req…
firebl0od Sep 7, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
javaVersion: '20'
- mcVersion: '1.20.6'
javaVersion: '21'
- mcVersion: '1.21.8'
javaVersion: '21'
#- mcVersion: 'latest'
# javaVersion: '21'

Expand Down
34 changes: 34 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Agent Instructions

To run Maven successfully behind the proxy, set the following environment variable before executing Maven commands:

```
export MAVEN_OPTS='-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -Dhttps.proxyHost=proxy -Dhttps.proxyPort=8080 -Djava.net.preferIPv4Stack=true'
```

Maven also expects a proxy configuration in `~/.m2/settings.xml`:

```
<settings>
<proxies>
<proxy>
<id>proxy-http</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy</host>
<port>8080</port>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
<proxy>
<id>proxy-https</id>
<active>true</active>
<protocol>https</protocol>
<host>proxy</host>
<port>8080</port>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>
</settings>
```

Ensure this file exists before running Maven to avoid network errors.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Table of contents
- [AI Test Fork Changelog](#ai-test-fork-changelog)
- [Release Candidate 38 (TBD)](#release-candidate-38-tbd)
- [Release Candidate 37 (25 Feb 2024)](#release-candidate-37-25-feb-2024)
- [Release Candidate 36 (20 Dec 2023)](#release-candidate-36-20-dec-2023)
Expand Down Expand Up @@ -38,8 +39,48 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## AI Test Fork Changelog

This fork aggregates closed pull requests to evaluate AI-driven automatic Minecraft version updates. Key pull requests include:

- **#1–#3**: Initial updates for Spigot 1.21.7.
- **#4–#6**: Additional compatibility fixes for 1.21.7.
- **#7–#12**: Upgraded to Spigot 1.21.x and refreshed dependencies.
- **#13**: Cleaned up merge conflicts.
- **#14–#21**: Continued updates based on integration file.
- **#22–#28**: Expanded Minecraft 1.21 integration, introducing version 1.21.8 support.
- **#29–#33**: Completed 1.21.x integration and reviewed for omissions.
- **#34–#36**: Ran comprehensive tests and resolved outstanding issues.
- **#37–#40**: Consolidated all updates and ensured tests pass.

This document serves as a test run to explore whether an AI agent can maintain Slimefun automatically.

## Release Candidate 38 (TBD)

#### Additions
* Produce Collector can brush Armadillos for Armadillo Scutes on 1.21+
* Auto-Brewer can brew Oozing, Weaving, Wind Charging and Infestation potions
* Auto crafters now require the new Crafter block in their recipes
* Wolf Armor craftable in the Armor Forge from Armadillo Scutes
* Copper Bulb craftable in the Enhanced Crafting Table
* Ominous Bottle craftable in the Magic Workbench
* Trial Key craftable in the Magic Workbench
* Vault and Trial Spawner craftable in the Enhanced Crafting Table
* Heavy Core craftable in the Enhanced Crafting Table
* Mace craftable in the Enhanced Crafting Table from a Breeze Rod and Heavy Core
* Ore Crusher and Electric Ore Grinder can crush Tuff and its variants into Sand

* Butcher Android collects Breeze Rods, Wind Charges and mushrooms from new mobs
* Butcher Android collects Creaking Hearts from Creakings
* Wind Charges, Armadillo Scutes and Creaking Hearts are listed as vanilla items in the Slimefun guide


#### Changes
* Restrict Minecraft 1.21 support to patches up to 1.21.8

#### Fixes
* Use matchMaterial for 1.21 item stacks to maintain backwards compatibility

## Release Candidate 37 (25 Feb 2024)

#### Additions
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ It currently adds over **500 new items and recipes** to Minecraft ([Read more ab

But it also comes with a lot of addons! Check out our [addons](https://github.com/Slimefun/Slimefun4/wiki/Addons), you may find exactly what you were looking for.

### Support for Minecraft 1.21
Slimefun now targets Spigot **1.21.x**. The plugin recognises new entities like Armadillos, Bogged, Breezes and Creakings and handles fresh potion effects and enchantments such as Oozing, Weaving, Wind Charged, Density, Breach and Wind Burst.

These additions integrate seamlessly with existing mechanics, allowing you to craft recipes and machines that interact with the latest vanilla content. You can automatically brew Oozing, Weaving, Wind Charging and Infestation potions, brush Armadillos for Scutes to craft Wolf Armor, harvest Breeze Rods, Wind Charges, mushrooms and Creaking Hearts with the Butcher Android, craft the Crafter, Copper Bulb, Ominous Bottle, Trial Key, Heavy Core, Mace, Vault and Trial Spawner, and grind Tuff variants into sand.


### Quick navigation
* **[:floppy_disk: Download Slimefun4](#floppy_disk-download-slimefun-4)**
* **[:framed_picture: Screenshots](#framed_picture-screenshots)**
Expand All @@ -30,7 +36,7 @@ Here is a full summary of the differences between the two different versions of

| | development (latest) | "stable" |
| ------------------ | -------- | -------- |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.20.\*** | :video_game: **1.16.\* - 1.20.\*** |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.21.\*** | :video_game: **1.16.\* - 1.21.\*** |
| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 16 (or higher)** |
| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: |
| **frequent updates** | :heavy_check_mark: | :x: |
Expand Down
41 changes: 41 additions & 0 deletions docs/1.21-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Minecraft 1.21 Integration Summary

This document summarises the new content introduced with Minecraft/Spigot 1.21.x and how Slimefun integrates it.

## New Entities
- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. The Produce Collector can brush nearby Armadillos for scutes.
- **Bogged** – a poison-shooting skeleton variant. The Butcher Android gathers Brown and Red Mushrooms from this mob.
- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. The Butcher Android collects Breeze Rods and Wind Charges.
- **Creaking** – hostile wood variant added in 1.21.2. The Butcher Android can harvest **Creaking Hearts**.

## New Items & Blocks
- **Crafter** – programmable redstone crafting block required in auto-crafter recipes.
- **Copper Bulb** – light-emitting block controllable via redstone and craftable in the Enhanced Crafting Table.
- **Tuff & Tuff Variants** – additional decorative stones that can be processed in grinders for stone-based resources.
- **Trial Spawner / Vault** – components of Trial Chambers craftable in the Enhanced Crafting Table.
- **Wind Charge & Breeze Rod** – dropped from Breezes and usable as ammunition or crafting ingredients.
- **Ominous Bottle** – applies new status effects and can be crafted in the Magic Workbench.
- **Heavy Core & Mace** – heavy weapon components from Trial Chambers; the Mace is forged from a Heavy Core and Breeze Rod.
- **Wolf Armor** – protection for tamed wolves, crafted in the Armor Forge using Armadillo Scutes.

## New Status Effects & Potions
Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available and can be produced using the corresponding potion types. The Auto-Brewer accepts **Slime Blocks**, **Cobwebs**, **Breeze Rods**, and **Stone** to craft these potions automatically.

## Current Integration
- Auto-crafter machines require the vanilla Crafter block in their recipes.
- Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes.
- Tuff and its variants can be crushed into sand by the Ore Crusher and Electric Ore Grinder.
- Auto-Brewer can brew Oozing, Weaving, Wind Charging and Infestation potions.
- Produce Collector can brush Armadillos for Armadillo Scutes.
- Butcher Android harvests Breeze Rods, Wind Charges, mushrooms from Bogged, and Creaking Hearts.
- Wind Charges, Armadillo Scutes and Creaking Hearts appear as vanilla items in the Slimefun guide.
- Medical Supplies cure Oozing, Weaving, Wind Charged and Infested effects.
- Copper Bulb can be crafted in the Enhanced Crafting Table.
- Ominous Bottle can be crafted in the Magic Workbench.
- Trial Key can be crafted in the Magic Workbench.
- Vault and Trial Spawner can be crafted in the Enhanced Crafting Table.
- Heavy Core can be crafted in the Enhanced Crafting Table.
- Mace can be crafted in the Enhanced Crafting Table using a Heavy Core and Breeze Rod.

## Status
All 1.21.x entities, blocks and items have corresponding drop tables, crafting recipes and machine interactions. No further 1.21-specific integration work is pending.
6 changes: 3 additions & 3 deletions docs/sop/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ This SOP will go over updating Slimefun to the newest Minecraft version, most of
### Updating Bukkit/Spigot

The first step is just updating Spigot in the pom.xml. This should only be done in 2 cases:
* There's a new major version (well, MC major - 1.19 -> 1.20 is a major)
* There's a new major version (well, MC major - 1.20 -> 1.21 is a major)
* There was a change within MC or Bukkit/Spigot that broke the API

To update the Spigot version, you will need to go to the `pom.xml` and find the `spigot.version` property, this will be within the `properties` property. Simply make this the MC version (e.g. `1.20` or in the case of minor `1.20.4`).
To update the Spigot version, you will need to go to the `pom.xml` and find the `spigot.version` property, this will be within the `properties` property. Simply make this the MC version (e.g. `1.21` or in the case of minor `1.21.8`).

Once updated, **make sure to run a build** to check for compilation failures with `mvn clean package -DskipTests=true`. We will go over the tests next.

Expand Down Expand Up @@ -66,6 +66,6 @@ While the PR is open, make sure to verify the E2E tests are passing, and you sho

**This is only needed in a major version**

In the `e2e-testing.yml` file you will need to update the matrix strategy, please add the latest version of the old major (e.g. if 1.21 came out, add 1.20.x where x is the latest released version). If MC is requiring a new Java version make sure that is updated too in the `latest` version.
In the `e2e-testing.yml` file you will need to update the matrix strategy, please add the latest version of the old major (e.g. if 1.22 came out, add 1.21.x where x is the latest released version). If MC is requiring a new Java version make sure that is updated too in the `latest` version.

Once updated, push and re-verify that the E2E tests are still passing.
43 changes: 30 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<groupId>com.github.slimefun</groupId>
<artifactId>Slimefun</artifactId>

<!-- Our default version will be UNOFFICIAL, this will prevent auto updates -->
<!-- from overriding our local test file -->
<version>4.9-UNOFFICIAL</version>
<!-- Use a valid numeric version so updater tests can parse it -->
<version>4.9.0-b0</version>
<inceptionYear>2013</inceptionYear>
<packaging>jar</packaging>

Expand All @@ -29,9 +28,12 @@
<maven.compiler.testTarget>21</maven.compiler.testTarget>

<!-- Spigot properties -->
<spigot.version>1.20.6</spigot.version>
<spigot.version>1.21.8</spigot.version>
<spigot.javadocs>https://hub.spigotmc.org/javadocs/spigot/</spigot.javadocs>

<!-- Testing framework -->
<junit.version>5.11.4</junit.version>

<!-- Default settings for sonarcloud.io -->
<sonar.projectKey>Slimefun_Slimefun4</sonar.projectKey>
<sonar.organization>slimefun</sonar.organization>
Expand All @@ -58,11 +60,6 @@
<!-- Repositories that host our dependencies -->
<!-- Well, any that aren't found on maven-central. -->
<repositories>
<repository>
<!-- Spigot-API -->
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<!-- PaperLib -->
<id>paper-repo</id>
Expand Down Expand Up @@ -98,6 +95,11 @@
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
<repository>
<!-- Maven Central fallback -->
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>

<build>
Expand Down Expand Up @@ -371,6 +373,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -389,7 +392,7 @@
<dependency>
<groupId>com.github.mockbukkit</groupId>
<artifactId>MockBukkit</artifactId>
<version>c7cc678834</version>
<version>v4.76.0</version>
<scope>test</scope>

<exclusions>
Expand All @@ -405,15 +408,15 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<version>1.21.8-R0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>

<!-- Third party plugin integrations / soft dependencies -->
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.3.9</version>
<version>7.3.16</version>
<scope>provided</scope>

<exclusions>
Expand All @@ -427,7 +430,7 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.3.9</version>
<version>7.3.16</version>
<scope>provided</scope>

<exclusions>
Expand Down Expand Up @@ -535,4 +538,18 @@
</exclusions>
</dependency>
</dependencies>

<profiles>
<profile>
<id>skip-mockbukkit</id>
<activation>
<property>
<name>skipMockBukkit</name>
</property>
</activation>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,22 @@ public enum MinecraftVersion {
* This constant represents Minecraft (Java Edition) Version 1.20
* ("The Trails &amp; Tales Update")
*/
MINECRAFT_1_20(20, 0, 4, "1.20.x"),
MINECRAFT_1_20(20, 0, "1.20.x"),

/**
* This constant represents Minecraft (Java Edition) Version 1.20.5
* ("The Armored Paws Update")
*/
MINECRAFT_1_20_5(20, 5, "1.20.5+"),

/**
* This constant represents Minecraft (Java Edition) Version 1.21
* ("The Tricky Trials Update")
*/

MINECRAFT_1_21(21, 0, 7, "1.21.x"),


/**
* This constant represents an exceptional state in which we were unable
* to identify the Minecraft Version we are using
Expand Down Expand Up @@ -209,10 +217,31 @@ public boolean isMinecraftVersion(int minecraftVersion) {
* @return Whether this {@link MinecraftVersion} matches the specified version id
*/
public boolean isMinecraftVersion(int minecraftVersion, int patchVersion) {
return !isVirtual()
&& this.majorVersion == minecraftVersion
&& (this.minorVersion == -1 || this.minorVersion <= patchVersion)
&& (this.maxMinorVersion == -1 || patchVersion <= this.maxMinorVersion);
if (isVirtual() || this.majorVersion != minecraftVersion) {
return false;
}

if (this == MINECRAFT_1_20) {
if (patchVersion == -1) {
return true;
}

return patchVersion >= 0 && patchVersion <= 4;
}

if (patchVersion == -1) {
return true;
}

if (this.maxMinorVersion != -1) {
return patchVersion >= this.minorVersion && patchVersion <= this.maxMinorVersion;
}

if (this.minorVersion == -1) {
return true;
}

return patchVersion >= this.minorVersion;
}

/**
Expand Down Expand Up @@ -288,7 +317,15 @@ public boolean isBefore(int minecraftVersion, int patchVersion) {
return this.majorVersion < minecraftVersion;
}

return this.minorVersion == -1 ? patchVersion > 0 : this.minorVersion < patchVersion;
if (this.minorVersion == -1) {
return patchVersion > 0;
}

if (this.maxMinorVersion != -1) {
return patchVersion > this.maxMinorVersion;
}

return this.minorVersion < patchVersion;
}

}
Loading
Loading