From e611fe367c038eba27a5975d6b870d5520c879ae Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 09:30:23 +0200 Subject: [PATCH 01/43] Add tests for new 1.21 registries --- .github/workflows/e2e-testing.yml | 2 + README.md | 2 +- docs/sop/update.md | 6 +- pom.xml | 6 +- .../slimefun4/api/MinecraftVersion.java | 6 ++ .../compatibility/VersionedEnchantment.java | 8 +++ .../compatibility/VersionedEntityType.java | 8 +++ .../VersionedPotionEffectType.java | 10 +++ .../compatibility/VersionedPotionType.java | 10 +++ .../slimefun4/utils/TestMinecraftVersion.java | 10 +++ .../utils/TestVersionedCompatibility.java | 43 ++++++++++++ src/test/resources/biomes/1.21.x.json | 67 +++++++++++++++++++ 12 files changed, 171 insertions(+), 7 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java create mode 100644 src/test/resources/biomes/1.21.x.json diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index e6be9ca39a..0d2cc6f9dc 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -29,6 +29,8 @@ jobs: javaVersion: '20' - mcVersion: '1.20.6' javaVersion: '21' + - mcVersion: '1.21.7' + javaVersion: '21' #- mcVersion: 'latest' # javaVersion: '21' diff --git a/README.md b/README.md index affc3ed96c..75f12b5912 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,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: | diff --git a/docs/sop/update.md b/docs/sop/update.md index 88470853b7..0c236a64ee 100644 --- a/docs/sop/update.md +++ b/docs/sop/update.md @@ -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.7`). 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. @@ -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. diff --git a/pom.xml b/pom.xml index 57d6c680ec..0c3b643599 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 21 - 1.20.6 + 1.21.7 https://hub.spigotmc.org/javadocs/spigot/ @@ -389,7 +389,7 @@ com.github.mockbukkit MockBukkit - c7cc678834 + v4.76.0 test @@ -405,7 +405,7 @@ io.papermc.paper paper-api - 1.20.6-R0.1-SNAPSHOT + 1.21.7-R0.1-SNAPSHOT test diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 4fc0160ac6..9cf27fcb30 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -55,6 +55,12 @@ public enum MinecraftVersion { */ 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, "1.21.x"), + /** * This constant represents an exceptional state in which we were unable * to identify the Minecraft Version we are using diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java index d5063ce413..135f9ace12 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java @@ -17,6 +17,9 @@ public class VersionedEnchantment { public static final Enchantment LUCK_OF_THE_SEA; public static final Enchantment AQUA_AFFINITY; public static final Enchantment FORTUNE; + public static final Enchantment DENSITY; + public static final Enchantment BREACH; + public static final Enchantment WIND_BURST; static { // DIG_SPEED is renamed to EFFICIENCY in 1.20.5 @@ -39,6 +42,11 @@ public class VersionedEnchantment { // LOOT_BONUS_BLOCKS is renamed to FORTUNE in 1.20.5 FORTUNE = getKey("fortune"); + + // Added in 1.21 + DENSITY = getKey("density"); + BREACH = getKey("breach"); + WIND_BURST = getKey("wind_burst"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 10ae11e803..9ddd6605e5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -13,6 +13,9 @@ public class VersionedEntityType { public static final EntityType MOOSHROOM; public static final EntityType SNOW_GOLEM; public static final EntityType FIREWORK; + public static final EntityType ARMADILLO; + public static final EntityType BOGGED; + public static final EntityType BREEZE; static { // MUSHROOM_COW is renamed to MOOSHROOM in 1.20.5 @@ -22,6 +25,11 @@ public class VersionedEntityType { SNOW_GOLEM = getKey("snow_golem"); FIREWORK = getKey("firework_rocket"); + + // Added in 1.21 + ARMADILLO = getKey("armadillo"); + BOGGED = getKey("bogged"); + BREEZE = getKey("breeze"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java index f3dbe6b6d1..49952e4067 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java @@ -22,6 +22,10 @@ public class VersionedPotionEffectType { public static final PotionEffectType JUMP_BOOST; public static final PotionEffectType NAUSEA; public static final PotionEffectType RESISTANCE; + public static final PotionEffectType OOZING; + public static final PotionEffectType WEAVING; + public static final PotionEffectType WIND_CHARGED; + public static final PotionEffectType INFESTED; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -61,6 +65,12 @@ public class VersionedPotionEffectType { RESISTANCE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? PotionEffectType.RESISTANCE : getKey("DAMAGE_RESISTANCE"); + + // Added in 1.21 + OOZING = getKey("OOZING"); + WEAVING = getKey("WEAVING"); + WIND_CHARGED = getKey("WIND_CHARGED"); + INFESTED = getKey("INFESTED"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java index 1713d77baf..c2483ec3b6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java @@ -18,6 +18,10 @@ public class VersionedPotionType { public static final PotionType HEALING; public static final PotionType HARMING; public static final PotionType REGENERATION; + public static final PotionType OOZING; + public static final PotionType WEAVING; + public static final PotionType WIND_CHARGED; + public static final PotionType INFESTED; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -41,6 +45,12 @@ public class VersionedPotionType { REGENERATION = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? PotionType.REGENERATION : getKey("REGEN"); + + // Added in 1.21 + OOZING = getKey("OOZING"); + WEAVING = getKey("WEAVING"); + WIND_CHARGED = getKey("WIND_CHARGED"); + INFESTED = getKey("INFESTED"); } @Nullable diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 74a2622cce..445d166ba1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -14,10 +14,12 @@ void testMatches() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16, -1)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17, -1)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 5)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(16, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(20, -1)); } @Test @@ -28,10 +30,12 @@ void testMatchesMinor() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 4)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 6)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, 7)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 5)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(17, 1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, -2)); } @Test @@ -42,8 +46,10 @@ void testAtLeast() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_18)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isAtLeast(MinecraftVersion.MINECRAFT_1_21)); } @Test @@ -61,9 +67,11 @@ void testAtLeastUnknown() { void testIsBefore() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_18)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(MinecraftVersion.MINECRAFT_1_21)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isBefore(MinecraftVersion.MINECRAFT_1_20_5)); } @Test @@ -82,6 +90,8 @@ void testIsBeforeMinor() { Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 4)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 5)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 6)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isBefore(21, 7)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(21, 0)); } @Test diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java new file mode 100644 index 0000000000..061d15db13 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java @@ -0,0 +1,43 @@ +package io.github.thebusybiscuit.slimefun4.utils; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; + +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; + +class TestVersionedCompatibility { + + @Test + void testNewEntityTypes() { + assertNotNull(VersionedEntityType.ARMADILLO); + assertNotNull(VersionedEntityType.BOGGED); + assertNotNull(VersionedEntityType.BREEZE); + } + + @Test + void testNewEnchantments() { + assertNotNull(VersionedEnchantment.DENSITY); + assertNotNull(VersionedEnchantment.BREACH); + assertNotNull(VersionedEnchantment.WIND_BURST); + } + + @Test + void testNewPotionEffects() { + assertNotNull(VersionedPotionEffectType.OOZING); + assertNotNull(VersionedPotionEffectType.WEAVING); + assertNotNull(VersionedPotionEffectType.WIND_CHARGED); + assertNotNull(VersionedPotionEffectType.INFESTED); + } + + @Test + void testNewPotionTypes() { + assertNotNull(VersionedPotionType.OOZING); + assertNotNull(VersionedPotionType.WEAVING); + assertNotNull(VersionedPotionType.WIND_CHARGED); + assertNotNull(VersionedPotionType.INFESTED); + } +} diff --git a/src/test/resources/biomes/1.21.x.json b/src/test/resources/biomes/1.21.x.json new file mode 100644 index 0000000000..dfe92f1834 --- /dev/null +++ b/src/test/resources/biomes/1.21.x.json @@ -0,0 +1,67 @@ +[ + "minecraft:ocean", + "minecraft:plains", + "minecraft:desert", + "minecraft:windswept_hills", + "minecraft:forest", + "minecraft:taiga", + "minecraft:swamp", + "minecraft:mangrove_swamp", + "minecraft:river", + "minecraft:nether_wastes", + "minecraft:the_end", + "minecraft:frozen_ocean", + "minecraft:frozen_river", + "minecraft:snowy_plains", + "minecraft:mushroom_fields", + "minecraft:beach", + "minecraft:jungle", + "minecraft:sparse_jungle", + "minecraft:deep_ocean", + "minecraft:stony_shore", + "minecraft:snowy_beach", + "minecraft:birch_forest", + "minecraft:dark_forest", + "minecraft:snowy_taiga", + "minecraft:old_growth_pine_taiga", + "minecraft:windswept_forest", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:badlands", + "minecraft:wooded_badlands", + "minecraft:small_end_islands", + "minecraft:end_midlands", + "minecraft:end_highlands", + "minecraft:end_barrens", + "minecraft:warm_ocean", + "minecraft:lukewarm_ocean", + "minecraft:cold_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_cold_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:the_void", + "minecraft:sunflower_plains", + "minecraft:windswept_gravelly_hills", + "minecraft:flower_forest", + "minecraft:ice_spikes", + "minecraft:old_growth_birch_forest", + "minecraft:old_growth_spruce_taiga", + "minecraft:windswept_savanna", + "minecraft:eroded_badlands", + "minecraft:bamboo_jungle", + "minecraft:soul_sand_valley", + "minecraft:crimson_forest", + "minecraft:warped_forest", + "minecraft:basalt_deltas", + "minecraft:dripstone_caves", + "minecraft:lush_caves", + "minecraft:deep_dark", + "minecraft:meadow", + "minecraft:grove", + "minecraft:snowy_slopes", + "minecraft:frozen_peaks", + "minecraft:jagged_peaks", + "minecraft:stony_peaks", + "minecraft:cherry_grove", + "minecraft:custom", +] \ No newline at end of file From 920c1f7e1bbdc31baba25c78c5e50be940a0a5f2 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 09:39:27 +0200 Subject: [PATCH 02/43] Add Armadillo scutes and cap 1.21 support --- CHANGELOG.md | 6 ++++++ .../slimefun4/api/MinecraftVersion.java | 2 +- .../machines/entities/ProduceCollector.java | 17 +++++++++++++++++ .../slimefun4/utils/TestMinecraftVersion.java | 3 ++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 453eb54984..7264da1161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ ## Release Candidate 38 (TBD) +#### Additions +* Produce Collector can brush Armadillos for Armadillo Scutes on 1.21+ + +#### Changes +* Restrict Minecraft 1.21 support to patches up to 1.21.7 + ## Release Candidate 37 (25 Feb 2024) #### Additions diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 9cf27fcb30..4ed8806eaf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -59,7 +59,7 @@ public enum MinecraftVersion { * This constant represents Minecraft (Java Edition) Version 1.21 * ("The Tricky Trials Update") */ - MINECRAFT_1_21(21, "1.21.x"), + MINECRAFT_1_21(21, 0, 7, "1.21.x"), /** * This constant represents an exceptional state in which we were unable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java index 24ecf5d86d..1cd4223ac0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java @@ -33,6 +33,7 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; @@ -81,6 +82,17 @@ protected void registerDefaultRecipes() { return false; } })); + + // Armadillo Scutes from Armadillos + addProduce(new AnimalProduce(new ItemStack(Material.BRUSH), new ItemStack(Material.ARMADILLO_SCUTE), n -> { + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21) + && n.getType() == VersionedEntityType.ARMADILLO + && n instanceof Ageable ageable) { + return ageable.isAdult(); + } else { + return false; + } + })); } /** @@ -127,6 +139,11 @@ public boolean isSynchronized() { displayRecipes.add(new CustomItemStack(Material.BOWL, null, "&fRequires &bMooshroom &fnearby")); displayRecipes.add(new ItemStack(Material.MUSHROOM_STEW)); + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { + displayRecipes.add(new CustomItemStack(Material.BRUSH, null, "&fRequires &bArmadillo &fnearby")); + displayRecipes.add(new ItemStack(Material.ARMADILLO_SCUTE)); + } + return displayRecipes; } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 445d166ba1..d9b2462f70 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -35,7 +35,7 @@ void testMatchesMinor() { Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 5)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(17, 1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, -2)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, 8)); } @Test @@ -91,6 +91,7 @@ void testIsBeforeMinor() { Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 5)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 6)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isBefore(21, 7)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isBefore(21, 8)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(21, 0)); } From 6c8bbc865b64268e259f67c22285cf1280d2ab08 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 09:56:38 +0200 Subject: [PATCH 03/43] Expose 1.21 particles --- .github/workflows/e2e-testing.yml | 2 + README.md | 2 +- docs/sop/update.md | 6 +- pom.xml | 6 +- .../slimefun4/api/MinecraftVersion.java | 6 ++ .../compatibility/VersionedEnchantment.java | 8 +++ .../compatibility/VersionedEntityType.java | 10 +++ .../compatibility/VersionedItemFlag.java | 7 +- .../compatibility/VersionedParticle.java | 16 +++++ .../VersionedPotionEffectType.java | 10 +++ .../compatibility/VersionedPotionType.java | 10 +++ .../slimefun4/utils/TestMinecraftVersion.java | 10 +++ .../utils/TestVersionedCompatibility.java | 62 +++++++++++++++++ src/test/resources/biomes/1.21.x.json | 67 +++++++++++++++++++ 14 files changed, 214 insertions(+), 8 deletions(-) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java create mode 100644 src/test/resources/biomes/1.21.x.json diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index e6be9ca39a..0d2cc6f9dc 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -29,6 +29,8 @@ jobs: javaVersion: '20' - mcVersion: '1.20.6' javaVersion: '21' + - mcVersion: '1.21.7' + javaVersion: '21' #- mcVersion: 'latest' # javaVersion: '21' diff --git a/README.md b/README.md index affc3ed96c..75f12b5912 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,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: | diff --git a/docs/sop/update.md b/docs/sop/update.md index 88470853b7..0c236a64ee 100644 --- a/docs/sop/update.md +++ b/docs/sop/update.md @@ -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.7`). 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. @@ -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. diff --git a/pom.xml b/pom.xml index 57d6c680ec..0c3b643599 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 21 - 1.20.6 + 1.21.7 https://hub.spigotmc.org/javadocs/spigot/ @@ -389,7 +389,7 @@ com.github.mockbukkit MockBukkit - c7cc678834 + v4.76.0 test @@ -405,7 +405,7 @@ io.papermc.paper paper-api - 1.20.6-R0.1-SNAPSHOT + 1.21.7-R0.1-SNAPSHOT test diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 4fc0160ac6..9cf27fcb30 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -55,6 +55,12 @@ public enum MinecraftVersion { */ 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, "1.21.x"), + /** * This constant represents an exceptional state in which we were unable * to identify the Minecraft Version we are using diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java index d5063ce413..135f9ace12 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java @@ -17,6 +17,9 @@ public class VersionedEnchantment { public static final Enchantment LUCK_OF_THE_SEA; public static final Enchantment AQUA_AFFINITY; public static final Enchantment FORTUNE; + public static final Enchantment DENSITY; + public static final Enchantment BREACH; + public static final Enchantment WIND_BURST; static { // DIG_SPEED is renamed to EFFICIENCY in 1.20.5 @@ -39,6 +42,11 @@ public class VersionedEnchantment { // LOOT_BONUS_BLOCKS is renamed to FORTUNE in 1.20.5 FORTUNE = getKey("fortune"); + + // Added in 1.21 + DENSITY = getKey("density"); + BREACH = getKey("breach"); + WIND_BURST = getKey("wind_burst"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 10ae11e803..23c4c34d57 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -13,6 +13,10 @@ public class VersionedEntityType { public static final EntityType MOOSHROOM; public static final EntityType SNOW_GOLEM; public static final EntityType FIREWORK; + public static final EntityType ARMADILLO; + public static final EntityType BOGGED; + public static final EntityType BREEZE; + public static final EntityType WIND_CHARGE; static { // MUSHROOM_COW is renamed to MOOSHROOM in 1.20.5 @@ -22,6 +26,12 @@ public class VersionedEntityType { SNOW_GOLEM = getKey("snow_golem"); FIREWORK = getKey("firework_rocket"); + + // Added in 1.21 + ARMADILLO = getKey("armadillo"); + BOGGED = getKey("bogged"); + BREEZE = getKey("breeze"); + WIND_CHARGE = getKey("wind_charge"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 507a903a23..5a1eb8a5a7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -11,8 +11,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; public class VersionedItemFlag { - + public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; + public static final ItemFlag HIDE_TOOLTIP; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -20,6 +21,10 @@ public class VersionedItemFlag { HIDE_ADDITIONAL_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? ItemFlag.HIDE_ADDITIONAL_TOOLTIP : getKey("HIDE_POTION_EFFECTS"); + + HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) + ? ItemFlag.HIDE_TOOLTIP + : HIDE_ADDITIONAL_TOOLTIP; } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index fafd340cc0..bee582710b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -21,6 +21,13 @@ public class VersionedParticle { public static final Particle WITCH; public static final Particle FIREWORK; public static final Particle ENCHANT; + public static final Particle BREEZE_WIND; + public static final Particle TRIAL_SPAWNER_DETECTION; + public static final Particle TRIAL_SPAWNER_DETECTION_OMINOUS; + public static final Particle TRIAL_SPAWNER_EJECTION; + public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; + public static final Particle TRIAL_SPAWNER_SMOKE; + public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -64,6 +71,15 @@ public class VersionedParticle { ENCHANT = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? Particle.ENCHANT : getKey("ENCHANTMENT_TABLE"); + + // Added in 1.21 + BREEZE_WIND = getKey("BREEZE_WIND"); + TRIAL_SPAWNER_DETECTION = getKey("TRIAL_SPAWNER_DETECTION"); + TRIAL_SPAWNER_DETECTION_OMINOUS = getKey("TRIAL_SPAWNER_DETECTION_OMINOUS"); + TRIAL_SPAWNER_EJECTION = getKey("TRIAL_SPAWNER_EJECTION"); + TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); + TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); + TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java index f3dbe6b6d1..49952e4067 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java @@ -22,6 +22,10 @@ public class VersionedPotionEffectType { public static final PotionEffectType JUMP_BOOST; public static final PotionEffectType NAUSEA; public static final PotionEffectType RESISTANCE; + public static final PotionEffectType OOZING; + public static final PotionEffectType WEAVING; + public static final PotionEffectType WIND_CHARGED; + public static final PotionEffectType INFESTED; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -61,6 +65,12 @@ public class VersionedPotionEffectType { RESISTANCE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? PotionEffectType.RESISTANCE : getKey("DAMAGE_RESISTANCE"); + + // Added in 1.21 + OOZING = getKey("OOZING"); + WEAVING = getKey("WEAVING"); + WIND_CHARGED = getKey("WIND_CHARGED"); + INFESTED = getKey("INFESTED"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java index 1713d77baf..c2483ec3b6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java @@ -18,6 +18,10 @@ public class VersionedPotionType { public static final PotionType HEALING; public static final PotionType HARMING; public static final PotionType REGENERATION; + public static final PotionType OOZING; + public static final PotionType WEAVING; + public static final PotionType WIND_CHARGED; + public static final PotionType INFESTED; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -41,6 +45,12 @@ public class VersionedPotionType { REGENERATION = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? PotionType.REGENERATION : getKey("REGEN"); + + // Added in 1.21 + OOZING = getKey("OOZING"); + WEAVING = getKey("WEAVING"); + WIND_CHARGED = getKey("WIND_CHARGED"); + INFESTED = getKey("INFESTED"); } @Nullable diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 74a2622cce..445d166ba1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -14,10 +14,12 @@ void testMatches() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16, -1)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17, -1)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 5)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(16, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0, -1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(20, -1)); } @Test @@ -28,10 +30,12 @@ void testMatchesMinor() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 4)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 6)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, 7)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 5)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(17, 1)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isMinecraftVersion(21, -2)); } @Test @@ -42,8 +46,10 @@ void testAtLeast() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_21.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_18)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isAtLeast(MinecraftVersion.MINECRAFT_1_21)); } @Test @@ -61,9 +67,11 @@ void testAtLeastUnknown() { void testIsBefore() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isBefore(MinecraftVersion.MINECRAFT_1_18)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(MinecraftVersion.MINECRAFT_1_21)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_17)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_16)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isBefore(MinecraftVersion.MINECRAFT_1_20_5)); } @Test @@ -82,6 +90,8 @@ void testIsBeforeMinor() { Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 4)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 5)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 6)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_21.isBefore(21, 7)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(21, 0)); } @Test diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java new file mode 100644 index 0000000000..0f80060882 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java @@ -0,0 +1,62 @@ +package io.github.thebusybiscuit.slimefun4.utils; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; + +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; + +class TestVersionedCompatibility { + + @Test + void testNewEntityTypes() { + assertNotNull(VersionedEntityType.ARMADILLO); + assertNotNull(VersionedEntityType.BOGGED); + assertNotNull(VersionedEntityType.BREEZE); + assertNotNull(VersionedEntityType.WIND_CHARGE); + } + + @Test + void testNewEnchantments() { + assertNotNull(VersionedEnchantment.DENSITY); + assertNotNull(VersionedEnchantment.BREACH); + assertNotNull(VersionedEnchantment.WIND_BURST); + } + + @Test + void testNewPotionEffects() { + assertNotNull(VersionedPotionEffectType.OOZING); + assertNotNull(VersionedPotionEffectType.WEAVING); + assertNotNull(VersionedPotionEffectType.WIND_CHARGED); + assertNotNull(VersionedPotionEffectType.INFESTED); + } + + @Test + void testNewPotionTypes() { + assertNotNull(VersionedPotionType.OOZING); + assertNotNull(VersionedPotionType.WEAVING); + assertNotNull(VersionedPotionType.WIND_CHARGED); + assertNotNull(VersionedPotionType.INFESTED); + } + + @Test + void testNewItemFlag() { + assertNotNull(VersionedItemFlag.HIDE_TOOLTIP); + } + + @Test + void testNewParticles() { + assertNotNull(VersionedParticle.BREEZE_WIND); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_DETECTION); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_DETECTION_OMINOUS); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_EJECTION); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_EJECTION_OMINOUS); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_SMOKE); + assertNotNull(VersionedParticle.TRIAL_SPAWNER_SMOKE_OMINOUS); + } +} diff --git a/src/test/resources/biomes/1.21.x.json b/src/test/resources/biomes/1.21.x.json new file mode 100644 index 0000000000..dfe92f1834 --- /dev/null +++ b/src/test/resources/biomes/1.21.x.json @@ -0,0 +1,67 @@ +[ + "minecraft:ocean", + "minecraft:plains", + "minecraft:desert", + "minecraft:windswept_hills", + "minecraft:forest", + "minecraft:taiga", + "minecraft:swamp", + "minecraft:mangrove_swamp", + "minecraft:river", + "minecraft:nether_wastes", + "minecraft:the_end", + "minecraft:frozen_ocean", + "minecraft:frozen_river", + "minecraft:snowy_plains", + "minecraft:mushroom_fields", + "minecraft:beach", + "minecraft:jungle", + "minecraft:sparse_jungle", + "minecraft:deep_ocean", + "minecraft:stony_shore", + "minecraft:snowy_beach", + "minecraft:birch_forest", + "minecraft:dark_forest", + "minecraft:snowy_taiga", + "minecraft:old_growth_pine_taiga", + "minecraft:windswept_forest", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:badlands", + "minecraft:wooded_badlands", + "minecraft:small_end_islands", + "minecraft:end_midlands", + "minecraft:end_highlands", + "minecraft:end_barrens", + "minecraft:warm_ocean", + "minecraft:lukewarm_ocean", + "minecraft:cold_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_cold_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:the_void", + "minecraft:sunflower_plains", + "minecraft:windswept_gravelly_hills", + "minecraft:flower_forest", + "minecraft:ice_spikes", + "minecraft:old_growth_birch_forest", + "minecraft:old_growth_spruce_taiga", + "minecraft:windswept_savanna", + "minecraft:eroded_badlands", + "minecraft:bamboo_jungle", + "minecraft:soul_sand_valley", + "minecraft:crimson_forest", + "minecraft:warped_forest", + "minecraft:basalt_deltas", + "minecraft:dripstone_caves", + "minecraft:lush_caves", + "minecraft:deep_dark", + "minecraft:meadow", + "minecraft:grove", + "minecraft:snowy_slopes", + "minecraft:frozen_peaks", + "minecraft:jagged_peaks", + "minecraft:stony_peaks", + "minecraft:cherry_grove", + "minecraft:custom", +] \ No newline at end of file From d4fabb586c7a402758b75eca60de627beb6d7757 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:06:51 +0200 Subject: [PATCH 04/43] feat: support crafter in cargo network --- pom.xml | 4 ++++ .../tags/cargo_supported_storage_blocks.json | 15 ++++++++------- .../slimefun4/utils/tags/TestSlimefunTags.java | 8 ++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 0c3b643599..48ac5bcc1e 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,9 @@ 1.21.7 https://hub.spigotmc.org/javadocs/spigot/ + + 5.11.4 + Slimefun_Slimefun4 slimefun @@ -371,6 +374,7 @@ org.junit.jupiter junit-jupiter + ${junit.version} test diff --git a/src/main/resources/tags/cargo_supported_storage_blocks.json b/src/main/resources/tags/cargo_supported_storage_blocks.json index eb960c5e48..cc02b20bb6 100644 --- a/src/main/resources/tags/cargo_supported_storage_blocks.json +++ b/src/main/resources/tags/cargo_supported_storage_blocks.json @@ -1,11 +1,12 @@ { - "values" : [ - "#slimefun:shulker_boxes", - "minecraft:chest", - "minecraft:trapped_chest", - "minecraft:barrel", - "minecraft:furnace", - "minecraft:dispenser", + "values" : [ + "#slimefun:shulker_boxes", + "minecraft:chest", + "minecraft:trapped_chest", + "minecraft:barrel", + "minecraft:crafter", + "minecraft:furnace", + "minecraft:dispenser", "minecraft:dropper", "minecraft:hopper", "minecraft:brewing_stand", diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java index 0e9fe8e3f6..5001300035 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java @@ -126,6 +126,14 @@ void testGetTag() { Assertions.assertThrows(IllegalArgumentException.class, () -> SlimefunTag.getTag(null)); } + @Test + @DisplayName("Crafter should be cargo-compatible") + void testCrafterIsCargoStorage() throws TagMisconfigurationException { + SlimefunTag.reloadAll(); + + Assertions.assertTrue(SlimefunTag.CARGO_SUPPORTED_STORAGE_BLOCKS.isTagged(Material.CRAFTER)); + } + private void assertNotCyclic(@Nonnull SlimefunTag tag) { Set visiting = new HashSet<>(); Set visited = new HashSet<>(); From a4eca0ea428641722abdcf0e1f305f1d768e8cd2 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:07:05 +0200 Subject: [PATCH 05/43] feat: support wind charge entity --- .../slimefun4/utils/compatibility/VersionedEntityType.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 9ddd6605e5..23c4c34d57 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType WIND_CHARGE; static { // MUSHROOM_COW is renamed to MOOSHROOM in 1.20.5 @@ -30,6 +31,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + WIND_CHARGE = getKey("wind_charge"); } @Nullable From 0999eb60cf6734ca296c8dacc6b898c91677a139 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:07:19 +0200 Subject: [PATCH 06/43] feat: add creaking entity type --- .../slimefun4/utils/compatibility/VersionedEntityType.java | 4 ++++ .../slimefun4/utils/TestVersionedCompatibility.java | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 9ddd6605e5..a565523785 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType CREAKING; static { // MUSHROOM_COW is renamed to MOOSHROOM in 1.20.5 @@ -30,6 +31,9 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + + // Added in 1.21.2 + CREAKING = getKey("creaking"); } @Nullable diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java index 061d15db13..6f36401c7a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java @@ -16,6 +16,7 @@ void testNewEntityTypes() { assertNotNull(VersionedEntityType.ARMADILLO); assertNotNull(VersionedEntityType.BOGGED); assertNotNull(VersionedEntityType.BREEZE); + assertNotNull(VersionedEntityType.CREAKING); } @Test From f2b0db8fd27d6c9f861162a2d983b12303e3ce9b Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:07:33 +0200 Subject: [PATCH 07/43] Add 1.21 particle compatibility --- .../utils/compatibility/VersionedParticle.java | 10 ++++++++++ .../slimefun4/utils/TestVersionedCompatibility.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index fafd340cc0..b6324d9d2f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -21,6 +21,10 @@ public class VersionedParticle { public static final Particle WITCH; public static final Particle FIREWORK; public static final Particle ENCHANT; + public static final Particle GUST; + public static final Particle SMALL_GUST; + public static final Particle GUST_EMITTER_LARGE; + public static final Particle GUST_EMITTER_SMALL; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -64,6 +68,12 @@ public class VersionedParticle { ENCHANT = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) ? Particle.ENCHANT : getKey("ENCHANTMENT_TABLE"); + + // Added in 1.21 + GUST = getKey("GUST"); + SMALL_GUST = getKey("SMALL_GUST"); + GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); + GUST_EMITTER_SMALL = getKey("GUST_EMITTER_SMALL"); } @Nullable diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java index 061d15db13..abe2a6ddfa 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java @@ -8,6 +8,7 @@ import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; class TestVersionedCompatibility { @@ -40,4 +41,12 @@ void testNewPotionTypes() { assertNotNull(VersionedPotionType.WIND_CHARGED); assertNotNull(VersionedPotionType.INFESTED); } + + @Test + void testNewParticles() { + assertNotNull(VersionedParticle.GUST); + assertNotNull(VersionedParticle.SMALL_GUST); + assertNotNull(VersionedParticle.GUST_EMITTER_LARGE); + assertNotNull(VersionedParticle.GUST_EMITTER_SMALL); + } } From ff28dc2ac43efcc928bdaea96e495e0007638416 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:25:10 +0200 Subject: [PATCH 08/43] Update for Spigot 1.21 --- README.md | 4 ++++ pom.xml | 6 +++--- .../commands/subcommands/BackpackCommand.java | 5 ++--- .../commands/subcommands/TeleporterCommand.java | 5 ++--- .../items/autocrafters/VanillaAutoCrafter.java | 17 +++++++++-------- .../slimefun4/utils/JsonUtils.java | 16 +--------------- 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 75f12b5912..f5e039e399 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ 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. + ### Quick navigation * **[:floppy_disk: Download Slimefun4](#floppy_disk-download-slimefun-4)** * **[:framed_picture: Screenshots](#framed_picture-screenshots)** diff --git a/pom.xml b/pom.xml index 48ac5bcc1e..9253dd8faf 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 21 - 1.21.7 + 1.21.8 https://hub.spigotmc.org/javadocs/spigot/ @@ -417,7 +417,7 @@ com.sk89q.worldedit worldedit-core - 7.3.9 + 7.3.16 provided @@ -431,7 +431,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.3.9 + 7.3.16 provided diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index 431d47cb66..3357d4cbb4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -52,10 +52,9 @@ public void onExecute(CommandSender sender, String[] args) { return; } - @SuppressWarnings("deprecation") - OfflinePlayer backpackOwner = Bukkit.getOfflinePlayer(args[1]); + OfflinePlayer backpackOwner = Bukkit.getOfflinePlayerIfCached(args[1]); - if (!(backpackOwner instanceof Player) && !backpackOwner.hasPlayedBefore()) { + if (backpackOwner == null) { Slimefun.getLocalization().sendMessage(sender, "commands.backpack.player-never-joined"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java index 891ba85059..bca984ed3c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java @@ -27,10 +27,9 @@ public void onExecute(CommandSender sender, String[] args) { Slimefun.getGPSNetwork().getTeleportationManager().openTeleporterGUI(player, player.getUniqueId(), player.getLocation().getBlock().getRelative(BlockFace.DOWN), 999999999); } else if (args.length == 2) { - @SuppressWarnings("deprecation") - OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(args[1]); + OfflinePlayer targetPlayer = Bukkit.getOfflinePlayerIfCached(args[1]); - if (targetPlayer.getName() != null) { + if (targetPlayer != null && targetPlayer.getName() != null) { Slimefun.getGPSNetwork().getTeleportationManager().openTeleporterGUI(player, targetPlayer.getUniqueId(), player.getLocation().getBlock().getRelative(BlockFace.DOWN), 999999999); } else { Slimefun.getLocalization().sendMessage(sender, "messages.unknown-player", msg -> msg.replace("%player%", args[1])); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java index e9c9c962dc..5975d6c441 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java @@ -75,16 +75,17 @@ public VanillaAutoCrafter(ItemGroup itemGroup, SlimefunItemStack item, RecipeTyp * But it is completely fine for this purpose since we only use * it for lookups. */ - @SuppressWarnings("deprecation") - NamespacedKey key = new NamespacedKey(values[0], values[1]); - Recipe keyedRecipe = Slimefun.getMinecraftRecipeService().getRecipe(key); + NamespacedKey key = NamespacedKey.fromString(values[0] + ":" + values[1]); + if (key != null) { + Recipe keyedRecipe = Slimefun.getMinecraftRecipeService().getRecipe(key); - if (keyedRecipe != null) { - boolean enabled = !container.has(recipeEnabledKey, PersistentDataType.BYTE); - AbstractRecipe recipe = AbstractRecipe.of(keyedRecipe); - recipe.setEnabled(enabled); + if (keyedRecipe != null) { + boolean enabled = !container.has(recipeEnabledKey, PersistentDataType.BYTE); + AbstractRecipe recipe = AbstractRecipe.of(keyedRecipe); + recipe.setEnabled(enabled); - return recipe; + return recipe; + } } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/JsonUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/JsonUtils.java index 57a7f3eb80..bddd1dc04d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/JsonUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/JsonUtils.java @@ -5,8 +5,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; /** * Some helper methods for dealing with Json data. @@ -30,20 +28,8 @@ private JsonUtils() {} * * @return The parsed {@link JsonElement} */ - @SuppressWarnings("deprecation") public static @Nonnull JsonElement parseString(@Nonnull String json) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_18)) { - /* - * As of 1.18 Spigot includes a newer version of Gson that - * favours static method access. - */ - return JsonParser.parseString(json); - } else { - /* - * For older versions, we will need to use this way. - */ - return new JsonParser().parse(json); - } + return JsonParser.parseString(json); } } From 91b6070e8f513c4d4f2fd8162579353129e76f7d Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:44:28 +0200 Subject: [PATCH 09/43] Integrate Crafter and Wolf Armor --- CHANGELOG.md | 2 ++ docs/1.21-integration.md | 30 +++++++++++++++++++ pom.xml | 5 ++++ .../setup/SlimefunItemSetup.java | 14 ++++++--- .../compatibility/VersionedEntityType.java | 2 ++ .../compatibility/VersionedItemFlag.java | 27 +++++++++++++++++ .../compatibility/VersionedParticle.java | 4 +++ 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 docs/1.21-integration.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7264da1161..3e1620fa98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ #### Additions * Produce Collector can brush Armadillos for Armadillo Scutes on 1.21+ +* Auto crafters now require the new Crafter block in their recipes +* Wolf Armor craftable in the Armor Forge from Armadillo Scutes #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md new file mode 100644 index 0000000000..d0fda54eb9 --- /dev/null +++ b/docs/1.21-integration.md @@ -0,0 +1,30 @@ +# Minecraft 1.21 Integration Plan + +This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. + +## New Entities +- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. +- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. +- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. + +## New Items & Blocks +- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. +- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. + +## New Status Effects & Potions +Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available and can be produced using the corresponding potion types. Slimefun machines dealing with potion brewing should support these types. + +## Current Integration +- Auto-crafter machines now require the vanilla Crafter block in their recipes. +- Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. + +## Next Steps +1. Implement remaining Slimefun recipes for the new blocks and items. +2. Extend mob drop tables and machines to interact with the new entities. +3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/pom.xml b/pom.xml index 9253dd8faf..6b3e46ba17 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,11 @@ codemc-repo https://repo.codemc.io/repository/maven-public/ + + + central + https://repo.maven.apache.org/maven2/ + diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 14575310af..4c9d08e928 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -1031,6 +1031,12 @@ public static void setup(@Nonnull Slimefun plugin) { SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K }, "GOLD_12K", false, new PotionEffect[0][0], plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) + .register(plugin); + new SlimefunItem(itemGroups.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.CLOTH, 8)) @@ -2682,24 +2688,24 @@ public int getCapacity() { .register(plugin); new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE)}, + new ItemStack[] {new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER)}, new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) .register(plugin); new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.ELECTRIC_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTER), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTER), null, SlimefunItems.ELECTRIC_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTER), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), null, SlimefunItems.CARGO_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTING_TABLE)}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTER)}) .setCapacity(256) .setEnergyConsumption(32) .register(plugin); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 96bd0a227e..8728cc5d6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType BREEZE_WIND_CHARGE; public static final EntityType CREAKING; public static final EntityType WIND_CHARGE; @@ -32,6 +33,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + BREEZE_WIND_CHARGE = getKey("breeze_wind_charge"); // Added in 1.21.2 CREAKING = getKey("creaking"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 5a1eb8a5a7..8591f82de5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -14,6 +14,19 @@ public class VersionedItemFlag { public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; public static final ItemFlag HIDE_TOOLTIP; + public static final ItemFlag HIDE_VILLAGER_VARIANT; + public static final ItemFlag HIDE_WEAPON; + public static final ItemFlag HIDE_WOLF_COLLAR; + public static final ItemFlag HIDE_WOLF_SOUND_VARIANT; + public static final ItemFlag HIDE_WOLF_VARIANT; + public static final ItemFlag HIDE_WRITABLE_BOOK_CONTENT; + public static final ItemFlag HIDE_WRITTEN_BOOK_CONTENT; + public static final ItemFlag HIDE_LLAMA_VARIANT; + public static final ItemFlag HIDE_AXOLOTL_VARIANT; + public static final ItemFlag HIDE_CAT_VARIANT; + public static final ItemFlag HIDE_CAT_COLLAR; + public static final ItemFlag HIDE_SHEEP_COLOR; + public static final ItemFlag HIDE_SHULKER_COLOR; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -25,6 +38,20 @@ public class VersionedItemFlag { HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? ItemFlag.HIDE_TOOLTIP : HIDE_ADDITIONAL_TOOLTIP; + + HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); + HIDE_WEAPON = getKey("HIDE_WEAPON"); + HIDE_WOLF_COLLAR = getKey("HIDE_WOLF_COLLAR"); + HIDE_WOLF_SOUND_VARIANT = getKey("HIDE_WOLF_SOUND_VARIANT"); + HIDE_WOLF_VARIANT = getKey("HIDE_WOLF_VARIANT"); + HIDE_WRITABLE_BOOK_CONTENT = getKey("HIDE_WRITABLE_BOOK_CONTENT"); + HIDE_WRITTEN_BOOK_CONTENT = getKey("HIDE_WRITTEN_BOOK_CONTENT"); + HIDE_LLAMA_VARIANT = getKey("HIDE_LLAMA_VARIANT"); + HIDE_AXOLOTL_VARIANT = getKey("HIDE_AXOLOTL_VARIANT"); + HIDE_CAT_VARIANT = getKey("HIDE_CAT_VARIANT"); + HIDE_CAT_COLLAR = getKey("HIDE_CAT_COLLAR"); + HIDE_SHEEP_COLOR = getKey("HIDE_SHEEP_COLOR"); + HIDE_SHULKER_COLOR = getKey("HIDE_SHULKER_COLOR"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index f9582c76eb..d9003d771c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -28,6 +28,8 @@ public class VersionedParticle { public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; public static final Particle TRIAL_SPAWNER_SMOKE; public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; + public static final Particle TRIAL_OMEN; + public static final Particle OMINOUS_SPAWNING; public static final Particle GUST; public static final Particle SMALL_GUST; public static final Particle GUST_EMITTER_LARGE; @@ -84,6 +86,8 @@ public class VersionedParticle { TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); + TRIAL_OMEN = getKey("TRIAL_OMEN"); + OMINOUS_SPAWNING = getKey("OMINOUS_SPAWNING"); GUST = getKey("GUST"); SMALL_GUST = getKey("SMALL_GUST"); GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); From a7596ac3c396a0a3eb899b983e77ed95b429adec Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:45:11 +0200 Subject: [PATCH 10/43] Add wolf armor recipe and expand medical cures --- docs/1.21-integration.md | 30 +++++++++++++++++++ .../implementation/SlimefunItems.java | 2 ++ .../items/medical/MedicalSupply.java | 6 ++++ .../setup/SlimefunItemSetup.java | 6 ++++ .../compatibility/VersionedEntityType.java | 2 ++ .../compatibility/VersionedItemFlag.java | 27 +++++++++++++++++ .../compatibility/VersionedParticle.java | 4 +++ 7 files changed, 77 insertions(+) create mode 100644 docs/1.21-integration.md diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md new file mode 100644 index 0000000000..b5d4462501 --- /dev/null +++ b/docs/1.21-integration.md @@ -0,0 +1,30 @@ +# Minecraft 1.21 Integration Plan + +This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. + +## New Entities +- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. +- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. +- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. + +## New Items & Blocks +- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. +- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. + +## New Status Effects & Potions +Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available and can be produced using the corresponding potion types. Slimefun machines dealing with potion brewing should support these types. + +## Next Steps +1. Implement Slimefun recipes for the new blocks and items. +2. Extend mob drop tables and machines to interact with the new entities. +3. Update documentation and in‑game guides once gameplay integration is finalized. + +## Progress +- Added a recipe for **Wolf Armor** crafted from Armadillo Scutes in the Enhanced Crafting Table. +- Medical supplies now cleanse the new status effects: `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED`. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index d3adb16e0b..4034095c2f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -64,6 +64,8 @@ private SlimefunItems() {} public static final SlimefunItemStack MEDICINE = new SlimefunItemStack("MEDICINE", Material.POTION, Color.RED, "&cMedicine", "", "&aLevel III - Medical Supply", "", "&fRestores 4 Hearts", "&fExtinguishes Fire", "&fCures Poison/Wither/Radiation"); public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager", "&eor &7a Zombified Piglin to", "&7instantly cure it from its curse"); + public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); + public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java index 350376eab8..98dcb49756 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java @@ -39,6 +39,12 @@ protected MedicalSupply(ItemGroup itemGroup, int healAmount, SlimefunItemStack i curedEffects.add(VersionedPotionEffectType.NAUSEA); curedEffects.add(PotionEffectType.BLINDNESS); curedEffects.add(PotionEffectType.BAD_OMEN); + + // Added in 1.21 + curedEffects.add(VersionedPotionEffectType.OOZING); + curedEffects.add(VersionedPotionEffectType.WEAVING); + curedEffects.add(VersionedPotionEffectType.WIND_CHARGED); + curedEffects.add(VersionedPotionEffectType.INFESTED); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 14575310af..64c3ef156e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -852,6 +852,12 @@ public static void setup(@Nonnull Slimefun plugin) { new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) .register(plugin); + new SlimefunItem(itemGroups.usefulItems, SlimefunItems.WOLF_ARMOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) + .register(plugin); + new SmeltersPickaxe(itemGroups.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) .register(plugin); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 96bd0a227e..8728cc5d6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType BREEZE_WIND_CHARGE; public static final EntityType CREAKING; public static final EntityType WIND_CHARGE; @@ -32,6 +33,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + BREEZE_WIND_CHARGE = getKey("breeze_wind_charge"); // Added in 1.21.2 CREAKING = getKey("creaking"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 5a1eb8a5a7..8591f82de5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -14,6 +14,19 @@ public class VersionedItemFlag { public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; public static final ItemFlag HIDE_TOOLTIP; + public static final ItemFlag HIDE_VILLAGER_VARIANT; + public static final ItemFlag HIDE_WEAPON; + public static final ItemFlag HIDE_WOLF_COLLAR; + public static final ItemFlag HIDE_WOLF_SOUND_VARIANT; + public static final ItemFlag HIDE_WOLF_VARIANT; + public static final ItemFlag HIDE_WRITABLE_BOOK_CONTENT; + public static final ItemFlag HIDE_WRITTEN_BOOK_CONTENT; + public static final ItemFlag HIDE_LLAMA_VARIANT; + public static final ItemFlag HIDE_AXOLOTL_VARIANT; + public static final ItemFlag HIDE_CAT_VARIANT; + public static final ItemFlag HIDE_CAT_COLLAR; + public static final ItemFlag HIDE_SHEEP_COLOR; + public static final ItemFlag HIDE_SHULKER_COLOR; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -25,6 +38,20 @@ public class VersionedItemFlag { HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? ItemFlag.HIDE_TOOLTIP : HIDE_ADDITIONAL_TOOLTIP; + + HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); + HIDE_WEAPON = getKey("HIDE_WEAPON"); + HIDE_WOLF_COLLAR = getKey("HIDE_WOLF_COLLAR"); + HIDE_WOLF_SOUND_VARIANT = getKey("HIDE_WOLF_SOUND_VARIANT"); + HIDE_WOLF_VARIANT = getKey("HIDE_WOLF_VARIANT"); + HIDE_WRITABLE_BOOK_CONTENT = getKey("HIDE_WRITABLE_BOOK_CONTENT"); + HIDE_WRITTEN_BOOK_CONTENT = getKey("HIDE_WRITTEN_BOOK_CONTENT"); + HIDE_LLAMA_VARIANT = getKey("HIDE_LLAMA_VARIANT"); + HIDE_AXOLOTL_VARIANT = getKey("HIDE_AXOLOTL_VARIANT"); + HIDE_CAT_VARIANT = getKey("HIDE_CAT_VARIANT"); + HIDE_CAT_COLLAR = getKey("HIDE_CAT_COLLAR"); + HIDE_SHEEP_COLOR = getKey("HIDE_SHEEP_COLOR"); + HIDE_SHULKER_COLOR = getKey("HIDE_SHULKER_COLOR"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index f9582c76eb..d9003d771c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -28,6 +28,8 @@ public class VersionedParticle { public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; public static final Particle TRIAL_SPAWNER_SMOKE; public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; + public static final Particle TRIAL_OMEN; + public static final Particle OMINOUS_SPAWNING; public static final Particle GUST; public static final Particle SMALL_GUST; public static final Particle GUST_EMITTER_LARGE; @@ -84,6 +86,8 @@ public class VersionedParticle { TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); + TRIAL_OMEN = getKey("TRIAL_OMEN"); + OMINOUS_SPAWNING = getKey("OMINOUS_SPAWNING"); GUST = getKey("GUST"); SMALL_GUST = getKey("SMALL_GUST"); GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); From ef4983313a40307d2b9382f18ab980fcffac8d17 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:50:00 +0200 Subject: [PATCH 11/43] Add recipes for new 1.21 blocks and armor --- docs/1.21-integration.md | 26 ++++++++++++++++++ .../setup/SlimefunItemSetup.java | 18 +++++++++++++ .../compatibility/VersionedEntityType.java | 2 ++ .../compatibility/VersionedItemFlag.java | 27 +++++++++++++++++++ .../compatibility/VersionedParticle.java | 4 +++ 5 files changed, 77 insertions(+) create mode 100644 docs/1.21-integration.md diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md new file mode 100644 index 0000000000..e767c0b26d --- /dev/null +++ b/docs/1.21-integration.md @@ -0,0 +1,26 @@ +# Minecraft 1.21 Integration Plan + +This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. + +## New Entities +- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. +- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. +- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. + +## New Items & Blocks +- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. +- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. + +## New Status Effects & Potions +Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available and can be produced using the corresponding potion types. Slimefun machines dealing with potion brewing should support these types. + +## Next Steps +1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. +2. Extend mob drop tables and machines to interact with the new entities. +3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 14575310af..441ed794ea 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2089,6 +2089,24 @@ public int getEnergyConsumption() { new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE}) .register(plugin); + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.CRAFTER), "CRAFTER", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE), + new ItemStack(Material.IRON_INGOT), new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DROPPER), + new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE)}) + .register(plugin); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.COPPER_BULB, 4), "COPPER_BULB", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.COPPER_BLOCK), null, + new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.BLAZE_ROD), new ItemStack(Material.REDSTONE), + null, new ItemStack(Material.COPPER_BLOCK), null}) + .register(plugin); + + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), + null, new ItemStack(Material.ARMADILLO_SCUTE), null, + null, new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) + .register(plugin); + new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_WOOL, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL)}, new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL, 8), new RainbowTickHandler(ColoredMaterial.WOOL)) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 96bd0a227e..8728cc5d6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType BREEZE_WIND_CHARGE; public static final EntityType CREAKING; public static final EntityType WIND_CHARGE; @@ -32,6 +33,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + BREEZE_WIND_CHARGE = getKey("breeze_wind_charge"); // Added in 1.21.2 CREAKING = getKey("creaking"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 5a1eb8a5a7..8591f82de5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -14,6 +14,19 @@ public class VersionedItemFlag { public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; public static final ItemFlag HIDE_TOOLTIP; + public static final ItemFlag HIDE_VILLAGER_VARIANT; + public static final ItemFlag HIDE_WEAPON; + public static final ItemFlag HIDE_WOLF_COLLAR; + public static final ItemFlag HIDE_WOLF_SOUND_VARIANT; + public static final ItemFlag HIDE_WOLF_VARIANT; + public static final ItemFlag HIDE_WRITABLE_BOOK_CONTENT; + public static final ItemFlag HIDE_WRITTEN_BOOK_CONTENT; + public static final ItemFlag HIDE_LLAMA_VARIANT; + public static final ItemFlag HIDE_AXOLOTL_VARIANT; + public static final ItemFlag HIDE_CAT_VARIANT; + public static final ItemFlag HIDE_CAT_COLLAR; + public static final ItemFlag HIDE_SHEEP_COLOR; + public static final ItemFlag HIDE_SHULKER_COLOR; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -25,6 +38,20 @@ public class VersionedItemFlag { HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? ItemFlag.HIDE_TOOLTIP : HIDE_ADDITIONAL_TOOLTIP; + + HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); + HIDE_WEAPON = getKey("HIDE_WEAPON"); + HIDE_WOLF_COLLAR = getKey("HIDE_WOLF_COLLAR"); + HIDE_WOLF_SOUND_VARIANT = getKey("HIDE_WOLF_SOUND_VARIANT"); + HIDE_WOLF_VARIANT = getKey("HIDE_WOLF_VARIANT"); + HIDE_WRITABLE_BOOK_CONTENT = getKey("HIDE_WRITABLE_BOOK_CONTENT"); + HIDE_WRITTEN_BOOK_CONTENT = getKey("HIDE_WRITTEN_BOOK_CONTENT"); + HIDE_LLAMA_VARIANT = getKey("HIDE_LLAMA_VARIANT"); + HIDE_AXOLOTL_VARIANT = getKey("HIDE_AXOLOTL_VARIANT"); + HIDE_CAT_VARIANT = getKey("HIDE_CAT_VARIANT"); + HIDE_CAT_COLLAR = getKey("HIDE_CAT_COLLAR"); + HIDE_SHEEP_COLOR = getKey("HIDE_SHEEP_COLOR"); + HIDE_SHULKER_COLOR = getKey("HIDE_SHULKER_COLOR"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index f9582c76eb..d9003d771c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -28,6 +28,8 @@ public class VersionedParticle { public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; public static final Particle TRIAL_SPAWNER_SMOKE; public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; + public static final Particle TRIAL_OMEN; + public static final Particle OMINOUS_SPAWNING; public static final Particle GUST; public static final Particle SMALL_GUST; public static final Particle GUST_EMITTER_LARGE; @@ -84,6 +86,8 @@ public class VersionedParticle { TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); + TRIAL_OMEN = getKey("TRIAL_OMEN"); + OMINOUS_SPAWNING = getKey("OMINOUS_SPAWNING"); GUST = getKey("GUST"); SMALL_GUST = getKey("SMALL_GUST"); GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); From afadee3efdc280eaebedcbe315a267e16f08ba49 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 10:50:22 +0200 Subject: [PATCH 12/43] feat: enable brewing of new 1.21 potions --- CHANGELOG.md | 1 + docs/1.21-integration.md | 26 ++++++++++++++++++ .../items/electric/machines/AutoBrewer.java | 8 ++++++ .../compatibility/VersionedEntityType.java | 2 ++ .../compatibility/VersionedItemFlag.java | 27 +++++++++++++++++++ .../compatibility/VersionedParticle.java | 4 +++ 6 files changed, 68 insertions(+) create mode 100644 docs/1.21-integration.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7264da1161..9bbc8681d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ #### Additions * Produce Collector can brush Armadillos for Armadillo Scutes on 1.21+ +* Auto-Brewer can brew Oozing, Weaving, Wind Charging and Infestation potions #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md new file mode 100644 index 0000000000..fd0f23cee9 --- /dev/null +++ b/docs/1.21-integration.md @@ -0,0 +1,26 @@ +# Minecraft 1.21 Integration Plan + +This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. + +## New Entities +- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. +- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. +- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. + +## New Items & Blocks +- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. +- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. + +## 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. + +## Next Steps +1. Implement Slimefun recipes for the new blocks and items. *(Auto-Brewer covers new potions; block recipes still pending)* +2. Extend mob drop tables and machines to interact with the new entities. +3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java index 962bc2d32f..39930ae3a0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java @@ -48,6 +48,14 @@ public class AutoBrewer extends AContainer implements NotHopperable { potionRecipes.put(Material.GOLDEN_CARROT, PotionType.NIGHT_VISION); potionRecipes.put(Material.TURTLE_HELMET, PotionType.TURTLE_MASTER); potionRecipes.put(Material.PHANTOM_MEMBRANE, PotionType.SLOW_FALLING); + potionRecipes.put(Material.SLIME_BLOCK, VersionedPotionType.OOZING); + potionRecipes.put(Material.COBWEB, VersionedPotionType.WEAVING); + potionRecipes.put(Material.STONE, VersionedPotionType.INFESTED); + + Material breezeRod = Material.matchMaterial("BREEZE_ROD"); + if (breezeRod != null) { + potionRecipes.put(breezeRod, VersionedPotionType.WIND_CHARGED); + } fermentations.put(VersionedPotionType.SWIFTNESS, PotionType.SLOWNESS); fermentations.put(VersionedPotionType.LEAPING, PotionType.SLOWNESS); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 96bd0a227e..8728cc5d6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType BREEZE_WIND_CHARGE; public static final EntityType CREAKING; public static final EntityType WIND_CHARGE; @@ -32,6 +33,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + BREEZE_WIND_CHARGE = getKey("breeze_wind_charge"); // Added in 1.21.2 CREAKING = getKey("creaking"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 5a1eb8a5a7..8591f82de5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -14,6 +14,19 @@ public class VersionedItemFlag { public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; public static final ItemFlag HIDE_TOOLTIP; + public static final ItemFlag HIDE_VILLAGER_VARIANT; + public static final ItemFlag HIDE_WEAPON; + public static final ItemFlag HIDE_WOLF_COLLAR; + public static final ItemFlag HIDE_WOLF_SOUND_VARIANT; + public static final ItemFlag HIDE_WOLF_VARIANT; + public static final ItemFlag HIDE_WRITABLE_BOOK_CONTENT; + public static final ItemFlag HIDE_WRITTEN_BOOK_CONTENT; + public static final ItemFlag HIDE_LLAMA_VARIANT; + public static final ItemFlag HIDE_AXOLOTL_VARIANT; + public static final ItemFlag HIDE_CAT_VARIANT; + public static final ItemFlag HIDE_CAT_COLLAR; + public static final ItemFlag HIDE_SHEEP_COLOR; + public static final ItemFlag HIDE_SHULKER_COLOR; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -25,6 +38,20 @@ public class VersionedItemFlag { HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? ItemFlag.HIDE_TOOLTIP : HIDE_ADDITIONAL_TOOLTIP; + + HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); + HIDE_WEAPON = getKey("HIDE_WEAPON"); + HIDE_WOLF_COLLAR = getKey("HIDE_WOLF_COLLAR"); + HIDE_WOLF_SOUND_VARIANT = getKey("HIDE_WOLF_SOUND_VARIANT"); + HIDE_WOLF_VARIANT = getKey("HIDE_WOLF_VARIANT"); + HIDE_WRITABLE_BOOK_CONTENT = getKey("HIDE_WRITABLE_BOOK_CONTENT"); + HIDE_WRITTEN_BOOK_CONTENT = getKey("HIDE_WRITTEN_BOOK_CONTENT"); + HIDE_LLAMA_VARIANT = getKey("HIDE_LLAMA_VARIANT"); + HIDE_AXOLOTL_VARIANT = getKey("HIDE_AXOLOTL_VARIANT"); + HIDE_CAT_VARIANT = getKey("HIDE_CAT_VARIANT"); + HIDE_CAT_COLLAR = getKey("HIDE_CAT_COLLAR"); + HIDE_SHEEP_COLOR = getKey("HIDE_SHEEP_COLOR"); + HIDE_SHULKER_COLOR = getKey("HIDE_SHULKER_COLOR"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index f9582c76eb..d9003d771c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -28,6 +28,8 @@ public class VersionedParticle { public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; public static final Particle TRIAL_SPAWNER_SMOKE; public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; + public static final Particle TRIAL_OMEN; + public static final Particle OMINOUS_SPAWNING; public static final Particle GUST; public static final Particle SMALL_GUST; public static final Particle GUST_EMITTER_LARGE; @@ -84,6 +86,8 @@ public class VersionedParticle { TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); + TRIAL_OMEN = getKey("TRIAL_OMEN"); + OMINOUS_SPAWNING = getKey("OMINOUS_SPAWNING"); GUST = getKey("GUST"); SMALL_GUST = getKey("SMALL_GUST"); GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); From 7ef10608c40c33a60d6d0071a3c42c689ceaff53 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:16:12 +0200 Subject: [PATCH 13/43] Add proxy instructions for agents --- AGENTS.md | 34 +++++++++++++++++++ CHANGELOG.md | 2 ++ docs/1.21-integration.md | 30 ++++++++++++++++ pom.xml | 10 +++--- .../commands/subcommands/BackpackCommand.java | 4 +-- .../subcommands/TeleporterCommand.java | 4 +-- .../implementation/items/medical/Bandage.java | 2 +- .../items/medical/MedicalSupply.java | 2 +- .../implementation/items/medical/Splint.java | 2 +- .../items/tools/ExplosiveTool.java | 9 ++++- .../items/weapons/VampireBlade.java | 2 +- .../setup/SlimefunItemSetup.java | 14 +++++--- .../slimefun4/utils/biomes/BiomeMap.java | 6 ++-- .../utils/biomes/BiomeMapParser.java | 25 +++++++------- .../compatibility/VersionedEntityType.java | 2 ++ .../compatibility/VersionedItemFlag.java | 29 +++++++++++++++- .../compatibility/VersionedParticle.java | 4 +++ 17 files changed, 146 insertions(+), 35 deletions(-) create mode 100644 AGENTS.md create mode 100644 docs/1.21-integration.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..33f757dfc3 --- /dev/null +++ b/AGENTS.md @@ -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`: + +``` + + + + proxy-http + true + http + proxy + 8080 + localhost|127.0.0.1 + + + proxy-https + true + https + proxy + 8080 + localhost|127.0.0.1 + + + +``` + +Ensure this file exists before running Maven to avoid network errors. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7264da1161..3e1620fa98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ #### Additions * Produce Collector can brush Armadillos for Armadillo Scutes on 1.21+ +* Auto crafters now require the new Crafter block in their recipes +* Wolf Armor craftable in the Armor Forge from Armadillo Scutes #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md new file mode 100644 index 0000000000..d0fda54eb9 --- /dev/null +++ b/docs/1.21-integration.md @@ -0,0 +1,30 @@ +# Minecraft 1.21 Integration Plan + +This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. + +## New Entities +- **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. +- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. +- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. + +## New Items & Blocks +- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. +- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. + +## New Status Effects & Potions +Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available and can be produced using the corresponding potion types. Slimefun machines dealing with potion brewing should support these types. + +## Current Integration +- Auto-crafter machines now require the vanilla Crafter block in their recipes. +- Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. + +## Next Steps +1. Implement remaining Slimefun recipes for the new blocks and items. +2. Extend mob drop tables and machines to interact with the new entities. +3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/pom.xml b/pom.xml index 9253dd8faf..a48211ffc5 100644 --- a/pom.xml +++ b/pom.xml @@ -61,11 +61,6 @@ - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots - paper-repo @@ -101,6 +96,11 @@ codemc-repo https://repo.codemc.io/repository/maven-public/ + + + central + https://repo.maven.apache.org/maven2/ + diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index 3357d4cbb4..acff4acffa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -52,9 +52,9 @@ public void onExecute(CommandSender sender, String[] args) { return; } - OfflinePlayer backpackOwner = Bukkit.getOfflinePlayerIfCached(args[1]); + OfflinePlayer backpackOwner = Bukkit.getOfflinePlayer(args[1]); - if (backpackOwner == null) { + if (!backpackOwner.hasPlayedBefore()) { Slimefun.getLocalization().sendMessage(sender, "commands.backpack.player-never-joined"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java index bca984ed3c..5ddcf15d31 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/TeleporterCommand.java @@ -27,9 +27,9 @@ public void onExecute(CommandSender sender, String[] args) { Slimefun.getGPSNetwork().getTeleportationManager().openTeleporterGUI(player, player.getUniqueId(), player.getLocation().getBlock().getRelative(BlockFace.DOWN), 999999999); } else if (args.length == 2) { - OfflinePlayer targetPlayer = Bukkit.getOfflinePlayerIfCached(args[1]); + OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(args[1]); - if (targetPlayer != null && targetPlayer.getName() != null) { + if (targetPlayer.hasPlayedBefore() && targetPlayer.getName() != null) { Slimefun.getGPSNetwork().getTeleportationManager().openTeleporterGUI(player, targetPlayer.getUniqueId(), player.getLocation().getBlock().getRelative(BlockFace.DOWN), 999999999); } else { Slimefun.getLocalization().sendMessage(sender, "messages.unknown-player", msg -> msg.replace("%player%", args[1])); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java index b87882cf6d..f315a0df8d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java @@ -42,7 +42,7 @@ public ItemUseHandler getItemHandler() { Player p = e.getPlayer(); // Player is neither burning nor injured - if (p.getFireTicks() <= 0 && p.getHealth() >= p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) { + if (p.getFireTicks() <= 0 && p.getHealth() >= p.getAttribute(Attribute.MAX_HEALTH).getValue()) { return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java index 350376eab8..284292f85f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java @@ -73,7 +73,7 @@ public void clearNegativeEffects(@Nonnull LivingEntity n) { */ public void heal(@Nonnull LivingEntity n) { double health = n.getHealth() + healAmount; - double maxHealth = n.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); + double maxHealth = n.getAttribute(Attribute.MAX_HEALTH).getValue(); n.setHealth(Math.min(health, maxHealth)); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java index 0a510ff28a..b85db3af7b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java @@ -31,7 +31,7 @@ public Splint(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType Player p = e.getPlayer(); // Player is neither burning nor injured - if (p.getFireTicks() <= 0 && p.getHealth() >= p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) { + if (p.getFireTicks() <= 0 && p.getHealth() >= p.getAttribute(Attribute.MAX_HEALTH).getValue()) { return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index 6fe1174e4f..ff27af0547 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -14,6 +14,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockExplodeEvent; +import org.bukkit.ExplosionResult; import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.protection.Interaction; @@ -78,7 +79,13 @@ private void breakBlocks(BlockBreakEvent e, Player p, ItemStack item, Block b, L List blocksToDestroy = new ArrayList<>(); if (callExplosionEvent.getValue()) { - BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0); + BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent( + b, + b.getState(), + blocks, + 0, + ExplosionResult.DESTROY + ); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/VampireBlade.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/VampireBlade.java index 006db130e2..43ce84dfdb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/VampireBlade.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/VampireBlade.java @@ -45,7 +45,7 @@ public VampireBlade(ItemGroup itemGroup, SlimefunItemStack item, RecipeType reci if (ThreadLocalRandom.current().nextInt(100) < getChance()) { SoundEffect.VAMPIRE_BLADE_HEALING_SOUND.playFor(p); double health = p.getHealth() + HEALING_AMOUNT; - double maxHealth = p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); + double maxHealth = p.getAttribute(Attribute.MAX_HEALTH).getValue(); p.setHealth(Math.min(health, maxHealth)); } }; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 14575310af..4c9d08e928 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -1031,6 +1031,12 @@ public static void setup(@Nonnull Slimefun plugin) { SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K }, "GOLD_12K", false, new PotionEffect[0][0], plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), + new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) + .register(plugin); + new SlimefunItem(itemGroups.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.CLOTH, 8)) @@ -2682,24 +2688,24 @@ public int getCapacity() { .register(plugin); new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE)}, + new ItemStack[] {new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER)}, new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) .register(plugin); new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.ELECTRIC_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTER), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTER), null, SlimefunItems.ELECTRIC_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTER), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), null, SlimefunItems.CARGO_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTING_TABLE)}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTER)}) .setCapacity(256) .setEnergyConsumption(32) .register(plugin); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java index 872972c687..784b82d5d3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java @@ -4,7 +4,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.util.EnumMap; +import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; @@ -43,9 +43,9 @@ public class BiomeMap implements Keyed { /** - * Our internal {@link EnumMap} holding all the data. + * Our internal {@link Map} holding all the data. */ - private final Map dataMap = new EnumMap<>(Biome.class); + private final Map dataMap = new HashMap<>(); /** * The {@link NamespacedKey} to identify this {@link BiomeMap}. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java index 62d345acf8..0656b9bfe4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java @@ -1,8 +1,7 @@ package io.github.thebusybiscuit.slimefun4.utils.biomes; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Locale; +import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -11,6 +10,7 @@ import org.apache.commons.lang.Validate; import org.bukkit.NamespacedKey; +import org.bukkit.Registry; import org.bukkit.block.Biome; import com.google.gson.JsonArray; @@ -18,10 +18,8 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import io.github.bakedlibs.dough.common.CommonPatterns; import io.github.thebusybiscuit.slimefun4.api.exceptions.BiomeMapException; import io.github.thebusybiscuit.slimefun4.utils.JsonUtils; -import io.github.thebusybiscuit.slimefun4.utils.PatternUtils; /** * The {@link BiomeMapParser} allows you to parse json data into a {@link BiomeMap}. @@ -40,7 +38,7 @@ public class BiomeMapParser { private final NamespacedKey key; private final BiomeDataConverter valueConverter; - private final Map map = new EnumMap<>(Biome.class); + private final Map map = new HashMap<>(); /** * This flag specifies whether the parsing is "lenient" or not. @@ -159,19 +157,20 @@ private void readEntry(@Nonnull JsonObject entry) throws BiomeMapException { private @Nonnull Set readBiomes(@Nonnull JsonArray array) throws BiomeMapException { Validate.notNull(array, "The JSON array should not be null!"); - Set biomes = EnumSet.noneOf(Biome.class); + Set biomes = new HashSet<>(); for (JsonElement element : array) { if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString()) { String value = element.getAsString(); - if (PatternUtils.MINECRAFT_NAMESPACEDKEY.matcher(value).matches()) { - String formattedValue = CommonPatterns.COLON.split(value)[1].toUpperCase(Locale.ROOT); + NamespacedKey biomeKey = NamespacedKey.fromString(value); - try { - Biome biome = Biome.valueOf(formattedValue); + if (biomeKey != null) { + Biome biome = Registry.BIOME.get(biomeKey); + + if (biome != null) { biomes.add(biome); - } catch (IllegalArgumentException x) { + } else { // Lenient Parsers will ignore unknown biomes if (isLenient) { continue; @@ -180,7 +179,7 @@ private void readEntry(@Nonnull JsonObject entry) throws BiomeMapException { throw new BiomeMapException(key, "The Biome '" + value + "' does not exist!"); } } else { - // The regular expression did not match + // The NamespacedKey could not be parsed throw new BiomeMapException(key, "Could not recognize value '" + value + "'"); } } else { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java index 96bd0a227e..8728cc5d6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -16,6 +16,7 @@ public class VersionedEntityType { public static final EntityType ARMADILLO; public static final EntityType BOGGED; public static final EntityType BREEZE; + public static final EntityType BREEZE_WIND_CHARGE; public static final EntityType CREAKING; public static final EntityType WIND_CHARGE; @@ -32,6 +33,7 @@ public class VersionedEntityType { ARMADILLO = getKey("armadillo"); BOGGED = getKey("bogged"); BREEZE = getKey("breeze"); + BREEZE_WIND_CHARGE = getKey("breeze_wind_charge"); // Added in 1.21.2 CREAKING = getKey("creaking"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index 5a1eb8a5a7..f999c0eff6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -14,6 +14,19 @@ public class VersionedItemFlag { public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; public static final ItemFlag HIDE_TOOLTIP; + public static final ItemFlag HIDE_VILLAGER_VARIANT; + public static final ItemFlag HIDE_WEAPON; + public static final ItemFlag HIDE_WOLF_COLLAR; + public static final ItemFlag HIDE_WOLF_SOUND_VARIANT; + public static final ItemFlag HIDE_WOLF_VARIANT; + public static final ItemFlag HIDE_WRITABLE_BOOK_CONTENT; + public static final ItemFlag HIDE_WRITTEN_BOOK_CONTENT; + public static final ItemFlag HIDE_LLAMA_VARIANT; + public static final ItemFlag HIDE_AXOLOTL_VARIANT; + public static final ItemFlag HIDE_CAT_VARIANT; + public static final ItemFlag HIDE_CAT_COLLAR; + public static final ItemFlag HIDE_SHEEP_COLOR; + public static final ItemFlag HIDE_SHULKER_COLOR; static { MinecraftVersion version = Slimefun.getMinecraftVersion(); @@ -23,8 +36,22 @@ public class VersionedItemFlag { : getKey("HIDE_POTION_EFFECTS"); HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) - ? ItemFlag.HIDE_TOOLTIP + ? getKey("HIDE_TOOLTIP") : HIDE_ADDITIONAL_TOOLTIP; + + HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); + HIDE_WEAPON = getKey("HIDE_WEAPON"); + HIDE_WOLF_COLLAR = getKey("HIDE_WOLF_COLLAR"); + HIDE_WOLF_SOUND_VARIANT = getKey("HIDE_WOLF_SOUND_VARIANT"); + HIDE_WOLF_VARIANT = getKey("HIDE_WOLF_VARIANT"); + HIDE_WRITABLE_BOOK_CONTENT = getKey("HIDE_WRITABLE_BOOK_CONTENT"); + HIDE_WRITTEN_BOOK_CONTENT = getKey("HIDE_WRITTEN_BOOK_CONTENT"); + HIDE_LLAMA_VARIANT = getKey("HIDE_LLAMA_VARIANT"); + HIDE_AXOLOTL_VARIANT = getKey("HIDE_AXOLOTL_VARIANT"); + HIDE_CAT_VARIANT = getKey("HIDE_CAT_VARIANT"); + HIDE_CAT_COLLAR = getKey("HIDE_CAT_COLLAR"); + HIDE_SHEEP_COLOR = getKey("HIDE_SHEEP_COLOR"); + HIDE_SHULKER_COLOR = getKey("HIDE_SHULKER_COLOR"); } @Nullable diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index f9582c76eb..d9003d771c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -28,6 +28,8 @@ public class VersionedParticle { public static final Particle TRIAL_SPAWNER_EJECTION_OMINOUS; public static final Particle TRIAL_SPAWNER_SMOKE; public static final Particle TRIAL_SPAWNER_SMOKE_OMINOUS; + public static final Particle TRIAL_OMEN; + public static final Particle OMINOUS_SPAWNING; public static final Particle GUST; public static final Particle SMALL_GUST; public static final Particle GUST_EMITTER_LARGE; @@ -84,6 +86,8 @@ public class VersionedParticle { TRIAL_SPAWNER_EJECTION_OMINOUS = getKey("TRIAL_SPAWNER_EJECTION_OMINOUS"); TRIAL_SPAWNER_SMOKE = getKey("TRIAL_SPAWNER_SMOKE"); TRIAL_SPAWNER_SMOKE_OMINOUS = getKey("TRIAL_SPAWNER_SMOKE_OMINOUS"); + TRIAL_OMEN = getKey("TRIAL_OMEN"); + OMINOUS_SPAWNING = getKey("OMINOUS_SPAWNING"); GUST = getKey("GUST"); SMALL_GUST = getKey("SMALL_GUST"); GUST_EMITTER_LARGE = getKey("GUST_EMITTER_LARGE"); From 2b1c6598cde9d522c75c245aea32a99b2220659e Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:35:49 +0200 Subject: [PATCH 14/43] build: add profile to skip mockbukkit tests --- CHANGELOG.md | 1 + pom.xml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06571f8234..c4f8e126df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ * 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 +* Add recipes for new 1.21 blocks and armor * Wolf Armor craftable in the Armor Forge from Armadillo Scutes #### Changes diff --git a/pom.xml b/pom.xml index a48211ffc5..32e26fdcbe 100644 --- a/pom.xml +++ b/pom.xml @@ -539,4 +539,18 @@ + + + + skip-mockbukkit + + + skipMockBukkit + + + + true + + + From 1040832383f1b150fee08604f865dd1b5f876eeb Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:43:39 +0200 Subject: [PATCH 15/43] feat: expand android drops for new mobs --- CHANGELOG.md | 1 + docs/1.21-integration.md | 2 ++ .../listeners/ButcherAndroidListener.java | 13 +++++++++++++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f8e126df..22ec220279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ * Auto crafters now require the new Crafter block in their recipes * Add recipes for new 1.21 blocks and armor * Wolf Armor craftable in the Armor Forge from Armadillo Scutes +* Butcher Android collects Breeze Rods, Wind Charges and mushrooms from new mobs #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index f6c6012f78..823709d22d 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -23,6 +23,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an ## Current Integration - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. +- Butcher Android now collects Breeze Rods, Wind Charges and mushrooms from the new mobs. ## Next Steps 1. Implement Slimefun recipes for the new blocks and items. *(Auto-Brewer covers new potions; block recipes still pending)* @@ -34,6 +35,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Medical supplies now cleanse the new status effects: `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED`. - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. +- Butcher Android gathers mushrooms from Bogged and Breeze loot like Breeze Rods and Wind Charges. 1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. 2. Extend mob drop tables and machines to interact with the new entities. 3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 9e63107680..49e5b38c28 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -23,6 +23,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.androids.AndroidInstance; import io.github.thebusybiscuit.slimefun4.implementation.items.androids.ButcherAndroid; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; /** * This {@link Listener} handles the collection of drops from an {@link Entity} that was @@ -92,5 +93,17 @@ private void addExtraDrops(List drops, EntityType entityType) { if (entityType == EntityType.VINDICATOR) { drops.add(new ItemStack(Material.EMERALD, 1 + random.nextInt(2))); } + + if (entityType == VersionedEntityType.BOGGED) { + drops.add(new ItemStack(Material.BROWN_MUSHROOM, 1 + random.nextInt(2))); + drops.add(new ItemStack(Material.RED_MUSHROOM, 1 + random.nextInt(2))); + } + + if (entityType == VersionedEntityType.BREEZE) { + drops.add(new ItemStack(Material.BREEZE_ROD)); + if (random.nextInt(3) == 0) { + drops.add(new ItemStack(Material.WIND_CHARGE)); + } + } } } From d4455cf3afdb101961333fd60e23512e9a2850d4 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:44:20 +0200 Subject: [PATCH 16/43] feat: add Breeze Rod mob drop --- docs/1.21-integration.md | 3 ++- .../slimefun4/implementation/SlimefunItems.java | 1 + .../slimefun4/implementation/setup/SlimefunItemSetup.java | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index f6c6012f78..f4017875a7 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -34,8 +34,9 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Medical supplies now cleanse the new status effects: `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED`. - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. +- Breezes drop **Breeze Rods** as custom mob drops for Slimefun. 1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. -2. Extend mob drop tables and machines to interact with the new entities. +2. Extend mob drop tables and machines to interact with the remaining new entities. 3. Update documentation and in‑game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 4034095c2f..781e7a4193 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -65,6 +65,7 @@ private SlimefunItems() {} public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager", "&eor &7a Zombified Piglin to", "&7instantly cure it from its curse"); public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); + public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 4d532695b0..904e7d8c19 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2113,6 +2113,10 @@ public int getEnergyConsumption() { null, new ItemStack(Material.COPPER_BLOCK), null}) .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.BREEZE_ROD, "BREEZE_ROD", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) + .register(plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), null, From fd3e57e89295987745fb57cfcce5695236b0f9a0 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:51:02 +0200 Subject: [PATCH 17/43] docs: clean up 1.21 integration plan --- docs/1.21-integration.md | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 0affe4f025..66331cf8de 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -4,17 +4,17 @@ This document tracks new content introduced with Minecraft/Spigot 1.21.x and how ## New Entities - **Armadillo** – drops *armadillo scutes* used to craft **wolf armor**. Could be integrated as a renewable resource in mob farms. -- **Bogged** – a poison‑shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. +- **Bogged** – a poison-shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. - **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. - **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. ## New Items & Blocks -- **Crafter** – programmable redstone crafting block. Might serve as a low‑tier automatic crafting machine or ingredient for existing Slimefun crafters. -- **Copper Bulb** – light‑emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. -- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone‑based resources. -- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot‑crate mechanics. +- **Crafter** – programmable redstone crafting block. Might serve as a low-tier automatic crafting machine or ingredient for existing Slimefun crafters. +- **Copper Bulb** – light-emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. +- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone-based resources. +- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot-crate mechanics. - **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. -- **Ominous Bottle** – applies new status effects; could be used in magic‑related machines. +- **Ominous Bottle** – applies new status effects; could be used in magic-related machines. - **Wolf Armor** – protection for tamed wolves, crafted using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. ## New Status Effects & Potions @@ -24,22 +24,11 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. - Butcher Android now collects Breeze Rods, Wind Charges and mushrooms from the new mobs. - -## Next Steps -1. Implement Slimefun recipes for the new blocks and items. *(Auto-Brewer covers new potions; block recipes still pending)* -2. Extend mob drop tables and machines to interact with the new entities. -3. Update documentation and in‑game guides once gameplay integration is finalized. - -## Progress -- Added a recipe for **Wolf Armor** crafted from Armadillo Scutes in the Enhanced Crafting Table. -- Medical supplies now cleanse the new status effects: `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED`. -- Auto-crafter machines now require the vanilla Crafter block in their recipes. -- Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. +- Medical supplies cleanse the new status effects: `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED`. - Breezes drop **Breeze Rods** as custom mob drops for Slimefun. -======= -- Butcher Android gathers mushrooms from Bogged and Breeze loot like Breeze Rods and Wind Charges. -1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. -2. Extend mob drop tables and machines to interact with the remaining new entities. -3. Update documentation and in‑game guides once gameplay integration is finalized. - +- Crafting support has been added for Crafter, Copper Bulb and Wolf Armor. +## Next Steps +1. Implement Slimefun recipes for the remaining new blocks and items (e.g., Tuff variants, Trial Spawner components, Ominous Bottle). +2. Extend mob drop tables and machines to interact with remaining entities such as the Creaking. +3. Update documentation and in-game guides once gameplay integration is finalized. From 20c7dc057497c6c16fa1ae18793f11db2322cdd7 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:52:05 +0200 Subject: [PATCH 18/43] feat: add armadillo scutes to butcher android drops --- CHANGELOG.md | 2 +- docs/1.21-integration.md | 8 ++------ .../implementation/listeners/ButcherAndroidListener.java | 4 ++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ec220279..2c6bfe59ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ * Auto crafters now require the new Crafter block in their recipes * Add recipes for new 1.21 blocks and armor * Wolf Armor craftable in the Armor Forge from Armadillo Scutes -* Butcher Android collects Breeze Rods, Wind Charges and mushrooms from new mobs +* Butcher Android collects Armadillo Scutes, Breeze Rods, Wind Charges and mushrooms from new mobs #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 0affe4f025..5295d9660f 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -23,7 +23,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an ## Current Integration - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. -- Butcher Android now collects Breeze Rods, Wind Charges and mushrooms from the new mobs. +- Butcher Android now collects Armadillo Scutes, Breeze Rods, Wind Charges and mushrooms from the new mobs. ## Next Steps 1. Implement Slimefun recipes for the new blocks and items. *(Auto-Brewer covers new potions; block recipes still pending)* @@ -36,10 +36,6 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. - Breezes drop **Breeze Rods** as custom mob drops for Slimefun. -======= -- Butcher Android gathers mushrooms from Bogged and Breeze loot like Breeze Rods and Wind Charges. -1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. -2. Extend mob drop tables and machines to interact with the remaining new entities. -3. Update documentation and in‑game guides once gameplay integration is finalized. +- Butcher Android gathers Armadillo Scutes, mushrooms from Bogged, and Breeze loot like Breeze Rods and Wind Charges. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 49e5b38c28..59c5f248e1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -99,6 +99,10 @@ private void addExtraDrops(List drops, EntityType entityType) { drops.add(new ItemStack(Material.RED_MUSHROOM, 1 + random.nextInt(2))); } + if (entityType == VersionedEntityType.ARMADILLO) { + drops.add(new ItemStack(Material.ARMADILLO_SCUTE, 1 + random.nextInt(2))); + } + if (entityType == VersionedEntityType.BREEZE) { drops.add(new ItemStack(Material.BREEZE_ROD)); if (random.nextInt(3) == 0) { From 8ec99d1504e6e2ec1ab3660d829da6776fba7b09 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 11:52:30 +0200 Subject: [PATCH 19/43] feat: add creaking drops --- CHANGELOG.md | 1 + docs/1.21-integration.md | 12 ++++-------- .../listeners/ButcherAndroidListener.java | 4 ++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ec220279..2438de75b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ * Add recipes for new 1.21 blocks and armor * Wolf Armor craftable in the Armor Forge from Armadillo Scutes * Butcher Android collects Breeze Rods, Wind Charges and mushrooms from new mobs +* Butcher Android collects Creaking Hearts from Creakings #### Changes * Restrict Minecraft 1.21 support to patches up to 1.21.7 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 0affe4f025..c90bf960fb 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -24,11 +24,10 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. - Butcher Android now collects Breeze Rods, Wind Charges and mushrooms from the new mobs. +- Butcher Android gathers Creaking Hearts from Creakings. ## Next Steps -1. Implement Slimefun recipes for the new blocks and items. *(Auto-Brewer covers new potions; block recipes still pending)* -2. Extend mob drop tables and machines to interact with the new entities. -3. Update documentation and in‑game guides once gameplay integration is finalized. +1. Update documentation and in‑game guides once gameplay integration is finalized. ## Progress - Added a recipe for **Wolf Armor** crafted from Armadillo Scutes in the Enhanced Crafting Table. @@ -36,10 +35,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - Auto-crafter machines now require the vanilla Crafter block in their recipes. - Wolf Armor can be crafted in the Armor Forge using Armadillo Scutes. - Breezes drop **Breeze Rods** as custom mob drops for Slimefun. -======= -- Butcher Android gathers mushrooms from Bogged and Breeze loot like Breeze Rods and Wind Charges. -1. **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. -2. Extend mob drop tables and machines to interact with the remaining new entities. -3. Update documentation and in‑game guides once gameplay integration is finalized. +- Butcher Android gathers mushrooms from Bogged, Breeze loot like Breeze Rods and Wind Charges, and collects Creaking Hearts from Creakings. +- **Done:** Added crafting support for Crafter, Copper Bulb and Wolf Armor. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 49e5b38c28..0719ccf618 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -105,5 +105,9 @@ private void addExtraDrops(List drops, EntityType entityType) { drops.add(new ItemStack(Material.WIND_CHARGE)); } } + + if (entityType == VersionedEntityType.CREAKING) { + drops.add(new ItemStack(Material.CREAKING_HEART)); + } } } From e7da3f3b70daace42f1717afa8529c9aa705acca Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:02:24 +0200 Subject: [PATCH 20/43] Allow tuff variants in ore grinder --- CHANGELOG.md | 1 + docs/1.21-integration.md | 3 ++- .../items/multiblocks/OreCrusher.java | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed80b6850..3354c02772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ * Auto crafters now require the new Crafter block in their recipes * Add recipes for new 1.21 blocks and armor * Wolf Armor craftable in the Armor Forge from Armadillo Scutes +* 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 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 3d14a89e66..e65196222e 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -23,9 +23,10 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an ## Current Integration - Auto-crafter machines now 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. ## Next Steps -1. Implement Slimefun recipes for the remaining new blocks and items (e.g., Tuff variants, Trial Spawner components, Ominous Bottle). +1. Implement Slimefun recipes for the remaining new blocks and items (e.g., Trial Spawner components, Ominous Bottle). 2. Extend mob drop tables and machines to interact with remaining entities such as the Creaking. 3. Update documentation and in-game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index ea5141f099..ddfd607eae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -107,6 +107,25 @@ protected void registerDefaultRecipes(List recipes) { recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE, 8)); recipes.add(new ItemStack(Material.SAND, 1)); } + + // Tuff and its variants can be crushed into sand + recipes.add(new ItemStack(Material.TUFF, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + + String[] tuffVariants = { + "POLISHED_TUFF", + "TUFF_BRICKS", + "POLISHED_TUFF_BRICKS", + "CHISELED_TUFF", + "CHISELED_TUFF_BRICKS" + }; + for (String variant : tuffVariants) { + Material mat = Material.matchMaterial(variant); + if (mat != null) { + recipes.add(new ItemStack(mat, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + } + } } public boolean isOreDoublingEnabled() { From 49bc257e88dd81c6525071cd2d24f0518f052567 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:27:05 +0200 Subject: [PATCH 21/43] Add Trial Chamber block recipes --- CHANGELOG.md | 5 ++++ README.md | 2 +- docs/1.21-integration.md | 13 ++++++-- .../items/multiblocks/OreCrusher.java | 19 ++++++++++++ .../setup/SlimefunItemSetup.java | 30 +++++++++++++++---- 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed80b6850..8e73ca5d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,11 @@ * Auto crafters now require the new Crafter block in their recipes * Add recipes for new 1.21 blocks and armor * 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 +* 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 diff --git a/README.md b/README.md index f5e039e399..fc1da538d8 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ But it also comes with a lot of addons! Check out our [addons](https://github.co ### 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. +These additions integrate seamlessly with existing mechanics, allowing you to craft recipes and machines that interact with the latest vanilla content. You can craft the Crafter, Copper Bulb, Ominous Bottle, Trial Key, Vault and Trial Spawner, grind Tuff variants into sand and harvest new mob drops with Slimefun automation. ### Quick navigation * **[:floppy_disk: Download Slimefun4](#floppy_disk-download-slimefun-4)** diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 3d14a89e66..c47e8b14b5 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -23,9 +23,16 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an ## Current Integration - Auto-crafter machines now 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. +- 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. ## Next Steps -1. Implement Slimefun recipes for the remaining new blocks and items (e.g., Tuff variants, Trial Spawner components, Ominous Bottle). -2. Extend mob drop tables and machines to interact with remaining entities such as the Creaking. -3. Update documentation and in-game guides once gameplay integration is finalized. +1. Finalize mob drop tables and machine interactions for any remaining 1.21 entities. +2. Update documentation and in-game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index ea5141f099..ddfd607eae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -107,6 +107,25 @@ protected void registerDefaultRecipes(List recipes) { recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE, 8)); recipes.add(new ItemStack(Material.SAND, 1)); } + + // Tuff and its variants can be crushed into sand + recipes.add(new ItemStack(Material.TUFF, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + + String[] tuffVariants = { + "POLISHED_TUFF", + "TUFF_BRICKS", + "POLISHED_TUFF_BRICKS", + "CHISELED_TUFF", + "CHISELED_TUFF_BRICKS" + }; + for (String variant : tuffVariants) { + Material mat = Material.matchMaterial(variant); + if (mat != null) { + recipes.add(new ItemStack(mat, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + } + } } public boolean isOreDoublingEnabled() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 904e7d8c19..9cf778ce14 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -1037,12 +1037,6 @@ public static void setup(@Nonnull Slimefun plugin) { SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K }, "GOLD_12K", false, new PotionEffect[0][0], plugin); - new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) - .register(plugin); - new SlimefunItem(itemGroups.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.CLOTH, 8)) @@ -2117,6 +2111,30 @@ null, new ItemStack(Material.COPPER_BLOCK), null}) new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.OMINOUS_BOTTLE), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(Material.BREEZE_ROD), new ItemStack(Material.COBWEB), + new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), + null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) + .register(plugin); + + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.TRIAL_KEY), "TRIAL_KEY", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.BREEZE_ROD, new ItemStack(Material.GOLD_INGOT), + null, new ItemStack(Material.TRIPWIRE_HOOK), null, + null, new ItemStack(Material.IRON_INGOT), null}) + .register(plugin); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.VAULT), "VAULT", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.CHEST), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK)}) + .register(plugin); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.TRIAL_SPAWNER), "TRIAL_SPAWNER", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.DEEPSLATE_BRICKS), SlimefunItems.BREEZE_ROD, new ItemStack(Material.DEEPSLATE_BRICKS), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.SPAWNER), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.DEEPSLATE_BRICKS), new ItemStack(Material.TRIAL_KEY), new ItemStack(Material.DEEPSLATE_BRICKS)}) + .register(plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), null, From d9b469cf8c63935e0ea7bb156992006ffe2f2167 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:37:49 +0200 Subject: [PATCH 22/43] Clarify Wolf Armor integration --- CHANGELOG.md | 6 +++- README.md | 2 +- docs/1.21-integration.md | 13 +++++-- .../items/multiblocks/OreCrusher.java | 19 ++++++++++ .../setup/SlimefunItemSetup.java | 36 ++++++++++++------- 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed80b6850..69fdc38604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,8 +44,12 @@ * 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 -* Add recipes for new 1.21 blocks and armor * 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 +* 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 diff --git a/README.md b/README.md index f5e039e399..36404abde2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ But it also comes with a lot of addons! Check out our [addons](https://github.co ### 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. +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, Vault and Trial Spawner, and grind Tuff variants into sand. ### Quick navigation * **[:floppy_disk: Download Slimefun4](#floppy_disk-download-slimefun-4)** diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 3d14a89e66..c47e8b14b5 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -23,9 +23,16 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an ## Current Integration - Auto-crafter machines now 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. +- 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. ## Next Steps -1. Implement Slimefun recipes for the remaining new blocks and items (e.g., Tuff variants, Trial Spawner components, Ominous Bottle). -2. Extend mob drop tables and machines to interact with remaining entities such as the Creaking. -3. Update documentation and in-game guides once gameplay integration is finalized. +1. Finalize mob drop tables and machine interactions for any remaining 1.21 entities. +2. Update documentation and in-game guides once gameplay integration is finalized. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index ea5141f099..ddfd607eae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -107,6 +107,25 @@ protected void registerDefaultRecipes(List recipes) { recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE, 8)); recipes.add(new ItemStack(Material.SAND, 1)); } + + // Tuff and its variants can be crushed into sand + recipes.add(new ItemStack(Material.TUFF, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + + String[] tuffVariants = { + "POLISHED_TUFF", + "TUFF_BRICKS", + "POLISHED_TUFF_BRICKS", + "CHISELED_TUFF", + "CHISELED_TUFF_BRICKS" + }; + for (String variant : tuffVariants) { + Material mat = Material.matchMaterial(variant); + if (mat != null) { + recipes.add(new ItemStack(mat, 8)); + recipes.add(new ItemStack(Material.SAND, 1)); + } + } } public boolean isOreDoublingEnabled() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 904e7d8c19..375d581fe8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -852,12 +852,6 @@ public static void setup(@Nonnull Slimefun plugin) { new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) .register(plugin); - new SlimefunItem(itemGroups.usefulItems, SlimefunItems.WOLF_ARMOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) - .register(plugin); - new SmeltersPickaxe(itemGroups.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) .register(plugin); @@ -1037,12 +1031,6 @@ public static void setup(@Nonnull Slimefun plugin) { SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K }, "GOLD_12K", false, new PotionEffect[0][0], plugin); - new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), - new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) - .register(plugin); - new SlimefunItem(itemGroups.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.CLOTH, 8)) @@ -2117,6 +2105,30 @@ null, new ItemStack(Material.COPPER_BLOCK), null}) new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.OMINOUS_BOTTLE), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(Material.BREEZE_ROD), new ItemStack(Material.COBWEB), + new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), + null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) + .register(plugin); + + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.TRIAL_KEY), "TRIAL_KEY", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.BREEZE_ROD, new ItemStack(Material.GOLD_INGOT), + null, new ItemStack(Material.TRIPWIRE_HOOK), null, + null, new ItemStack(Material.IRON_INGOT), null}) + .register(plugin); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.VAULT), "VAULT", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.CHEST), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK)}) + .register(plugin); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.TRIAL_SPAWNER), "TRIAL_SPAWNER", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.DEEPSLATE_BRICKS), SlimefunItems.BREEZE_ROD, new ItemStack(Material.DEEPSLATE_BRICKS), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.SPAWNER), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.DEEPSLATE_BRICKS), new ItemStack(Material.TRIAL_KEY), new ItemStack(Material.DEEPSLATE_BRICKS)}) + .register(plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), null, From d8019f581fd0acda464b92ec8ca6dea867981dd6 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:56:26 +0200 Subject: [PATCH 23/43] feat: add heavy core and mace recipes --- CHANGELOG.md | 2 ++ README.md | 2 +- docs/1.21-integration.md | 3 +++ .../slimefun4/implementation/SlimefunItems.java | 2 ++ .../implementation/setup/SlimefunItemSetup.java | 12 ++++++++++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fdc38604..4bde80c691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ * 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 diff --git a/README.md b/README.md index 5e734d140b..ed7373084a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ But it also comes with a lot of addons! Check out our [addons](https://github.co ### 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, Vault and Trial Spawner, and grind Tuff variants into sand. +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 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index c47e8b14b5..caf1652fdf 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -15,6 +15,7 @@ This document tracks new content introduced with Minecraft/Spigot 1.21.x and how - **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot-crate mechanics. - **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. - **Ominous Bottle** – applies new status effects; could be used in magic-related machines. +- **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 using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. ## New Status Effects & Potions @@ -31,6 +32,8 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - 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. ## Next Steps 1. Finalize mob drop tables and machine interactions for any remaining 1.21 entities. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 781e7a4193..5b2489d283 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -66,6 +66,8 @@ private SlimefunItems() {} public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); + public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack("HEAVY_CORE", Material.HEAVY_CORE, "&6Heavy Core"); + public static final SlimefunItemStack MACE = new SlimefunItemStack("MACE", Material.MACE, "&6Mace"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 375d581fe8..f1d4addec8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2129,6 +2129,18 @@ null, new ItemStack(Material.IRON_INGOT), null}) new ItemStack(Material.DEEPSLATE_BRICKS), new ItemStack(Material.TRIAL_KEY), new ItemStack(Material.DEEPSLATE_BRICKS)}) .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.HEAVY_CORE), "HEAVY_CORE", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), + new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.NETHERITE_INGOT), new ItemStack(Material.IRON_BLOCK), + new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) + .register(plugin); + + new VanillaItem(itemGroups.weapons, new ItemStack(Material.MACE), "MACE", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BREEZE_ROD, null, + null, SlimefunItems.HEAVY_CORE, null, + null, null, null}) + .register(plugin); + new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), null, new ItemStack(Material.ARMADILLO_SCUTE), null, From 182482610f2934f1dfc9b9b191e66cfc5ce99f59 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:56:39 +0200 Subject: [PATCH 24/43] chore: update 1.21 integration --- .github/workflows/e2e-testing.yml | 2 +- CHANGELOG.md | 2 +- docs/sop/update.md | 2 +- pom.xml | 2 +- .../github/thebusybiscuit/slimefun4/api/MinecraftVersion.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 0d2cc6f9dc..3f2fc6bb55 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -29,7 +29,7 @@ jobs: javaVersion: '20' - mcVersion: '1.20.6' javaVersion: '21' - - mcVersion: '1.21.7' + - mcVersion: '1.21.8' javaVersion: '21' #- mcVersion: 'latest' # javaVersion: '21' diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fdc38604..7696a61de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ #### Changes -* Restrict Minecraft 1.21 support to patches up to 1.21.7 +* Restrict Minecraft 1.21 support to patches up to 1.21.8 ## Release Candidate 37 (25 Feb 2024) diff --git a/docs/sop/update.md b/docs/sop/update.md index 0c236a64ee..cb1b69e9b7 100644 --- a/docs/sop/update.md +++ b/docs/sop/update.md @@ -15,7 +15,7 @@ The first step is just updating Spigot in the pom.xml. This should only be done * 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.21` or in the case of minor `1.21.7`). +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. diff --git a/pom.xml b/pom.xml index 32e26fdcbe..a201b43c44 100644 --- a/pom.xml +++ b/pom.xml @@ -409,7 +409,7 @@ io.papermc.paper paper-api - 1.21.7-R0.1-SNAPSHOT + 1.21.8-R0.1-SNAPSHOT test diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index fef57a0abc..daa96b5625 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -60,7 +60,7 @@ public enum MinecraftVersion { * ("The Tricky Trials Update") */ - MINECRAFT_1_21(21, 0, 7, "1.21.x"), + MINECRAFT_1_21(21, 0, 8, "1.21.x"), /** From 7c6b2cd001f83f3aa8d16083f81a480655460bd7 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:57:05 +0200 Subject: [PATCH 25/43] test: cover AutoBrewer 1.21 potions --- docs/1.21-integration.md | 1 + .../machines/TestAutoBrewerPotions.java | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index c47e8b14b5..fe7dba9c06 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -27,6 +27,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - 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. +- 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. diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java new file mode 100644 index 0000000000..17f84f0c14 --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java @@ -0,0 +1,40 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.lang.reflect.Field; +import java.util.Map; + +import org.bukkit.Material; +import org.bukkit.potion.PotionType; +import org.junit.jupiter.api.Test; + +import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.AutoBrewer; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; + +class TestAutoBrewerPotions { + + @SuppressWarnings("unchecked") + private Map getPotionRecipes() throws Exception { + Field field = AutoBrewer.class.getDeclaredField("potionRecipes"); + field.setAccessible(true); + return (Map) field.get(null); + } + + @Test + void testNewPotionRecipes() throws Exception { + Map recipes = getPotionRecipes(); + + assertEquals(VersionedPotionType.OOZING, recipes.get(Material.SLIME_BLOCK)); + assertEquals(VersionedPotionType.WEAVING, recipes.get(Material.COBWEB)); + assertEquals(VersionedPotionType.INFESTED, recipes.get(Material.STONE)); + + Material breezeRod = Material.matchMaterial("BREEZE_ROD"); + if (breezeRod != null) { + assertEquals(VersionedPotionType.WIND_CHARGED, recipes.get(breezeRod)); + } else { + assertNotNull(breezeRod, "BREEZE_ROD material should exist on 1.21"); + } + } +} From 3d12dc1e1a9bb11ff288d7a20178fd4c76ee6875 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 12:57:28 +0200 Subject: [PATCH 26/43] Register new 1.21 vanilla drops --- CHANGELOG.md | 1 + docs/1.21-integration.md | 1 + .../slimefun4/implementation/SlimefunItems.java | 3 +++ .../implementation/setup/SlimefunItemSetup.java | 12 ++++++++++++ 4 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fdc38604..2a02be7e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ * 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 diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index c47e8b14b5..2715a3f764 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -27,6 +27,7 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - 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. - 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. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 781e7a4193..5daf4f799a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -66,6 +66,9 @@ private SlimefunItems() {} public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); + public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack("WIND_CHARGE", Material.WIND_CHARGE, "&bWind Charge"); + public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack("ARMADILLO_SCUTE", Material.ARMADILLO_SCUTE, "&6Armadillo Scute"); + public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack("CREAKING_HEART", Material.CREAKING_HEART, "&cCreaking Heart"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 375d581fe8..972bf2564b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2105,6 +2105,18 @@ null, new ItemStack(Material.COPPER_BLOCK), null}) new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.WIND_CHARGE, "WIND_CHARGE", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) + .register(plugin); + + new VanillaItem(itemGroups.magicalResources, SlimefunItems.ARMADILLO_SCUTE, "ARMADILLO_SCUTE", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.ARMADILLO_SPAWN_EGG), "&aArmadillo"), null, null, null, null}) + .register(plugin); + + new VanillaItem(itemGroups.magicalResources, SlimefunItems.CREAKING_HEART, "CREAKING_HEART", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.CREAKING_SPAWN_EGG), "&aCreaking"), null, null, null, null}) + .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.OMINOUS_BOTTLE), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(Material.BREEZE_ROD), new ItemStack(Material.COBWEB), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), From 4eef8d1833516d0fc0d31e4899e19d2f8dda0e57 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:20:02 +0200 Subject: [PATCH 27/43] Guard 1.21 items behind version checks --- .../implementation/SlimefunItems.java | 20 ++- .../machines/entities/ProduceCollector.java | 26 +-- .../listeners/ButcherAndroidListener.java | 20 ++- .../setup/SlimefunItemSetup.java | 152 ++++++++++-------- 4 files changed, 130 insertions(+), 88 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 5b2489d283..e0c9c23793 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -64,10 +64,22 @@ private SlimefunItems() {} public static final SlimefunItemStack MEDICINE = new SlimefunItemStack("MEDICINE", Material.POTION, Color.RED, "&cMedicine", "", "&aLevel III - Medical Supply", "", "&fRestores 4 Hearts", "&fExtinguishes Fire", "&fCures Poison/Wither/Radiation"); public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager", "&eor &7a Zombified Piglin to", "&7instantly cure it from its curse"); - public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); - public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); - public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack("HEAVY_CORE", Material.HEAVY_CORE, "&6Heavy Core"); - public static final SlimefunItemStack MACE = new SlimefunItemStack("MACE", Material.MACE, "&6Mace"); + public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack( + "WOLF_ARMOR", + Material.matchMaterial("WOLF_ARMOR") == null ? Material.LEATHER_CHESTPLATE : Material.matchMaterial("WOLF_ARMOR"), + "&6Wolf Armor"); + public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack( + "BREEZE_ROD", + Material.matchMaterial("BREEZE_ROD") == null ? Material.BLAZE_ROD : Material.matchMaterial("BREEZE_ROD"), + "&bBreeze Rod"); + public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack( + "HEAVY_CORE", + Material.matchMaterial("HEAVY_CORE") == null ? Material.IRON_BLOCK : Material.matchMaterial("HEAVY_CORE"), + "&6Heavy Core"); + public static final SlimefunItemStack MACE = new SlimefunItemStack( + "MACE", + Material.matchMaterial("MACE") == null ? Material.DIAMOND_SWORD : Material.matchMaterial("MACE"), + "&6Mace"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java index 1cd4223ac0..f4e9684748 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java @@ -84,15 +84,18 @@ protected void registerDefaultRecipes() { })); // Armadillo Scutes from Armadillos - addProduce(new AnimalProduce(new ItemStack(Material.BRUSH), new ItemStack(Material.ARMADILLO_SCUTE), n -> { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21) - && n.getType() == VersionedEntityType.ARMADILLO - && n instanceof Ageable ageable) { - return ageable.isAdult(); - } else { - return false; + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { + Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); + if (scute != null) { + addProduce(new AnimalProduce(new ItemStack(Material.BRUSH), new ItemStack(scute), n -> { + if (n.getType() == VersionedEntityType.ARMADILLO && n instanceof Ageable ageable) { + return ageable.isAdult(); + } else { + return false; + } + })); } - })); + } } /** @@ -140,8 +143,11 @@ public boolean isSynchronized() { displayRecipes.add(new ItemStack(Material.MUSHROOM_STEW)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { - displayRecipes.add(new CustomItemStack(Material.BRUSH, null, "&fRequires &bArmadillo &fnearby")); - displayRecipes.add(new ItemStack(Material.ARMADILLO_SCUTE)); + Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); + if (scute != null) { + displayRecipes.add(new CustomItemStack(Material.BRUSH, null, "&fRequires &bArmadillo &fnearby")); + displayRecipes.add(new ItemStack(scute)); + } } return displayRecipes; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 2ec04c1565..6db469fcc2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -99,19 +99,25 @@ private void addExtraDrops(List drops, EntityType entityType) { drops.add(new ItemStack(Material.RED_MUSHROOM, 1 + random.nextInt(2))); } - if (entityType == VersionedEntityType.ARMADILLO) { - drops.add(new ItemStack(Material.ARMADILLO_SCUTE, 1 + random.nextInt(2))); + Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); + if (entityType == VersionedEntityType.ARMADILLO && scute != null) { + drops.add(new ItemStack(scute, 1 + random.nextInt(2))); } + Material breezeRod = Material.matchMaterial("BREEZE_ROD"); + Material windCharge = Material.matchMaterial("WIND_CHARGE"); if (entityType == VersionedEntityType.BREEZE) { - drops.add(new ItemStack(Material.BREEZE_ROD)); - if (random.nextInt(3) == 0) { - drops.add(new ItemStack(Material.WIND_CHARGE)); + if (breezeRod != null) { + drops.add(new ItemStack(breezeRod)); + } + if (windCharge != null && random.nextInt(3) == 0) { + drops.add(new ItemStack(windCharge)); } } - if (entityType == VersionedEntityType.CREAKING) { - drops.add(new ItemStack(Material.CREAKING_HEART)); + Material creakingHeart = Material.matchMaterial("CREAKING_HEART"); + if (entityType == VersionedEntityType.CREAKING && creakingHeart != null) { + drops.add(new ItemStack(creakingHeart)); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index f1d4addec8..1ed9c45685 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2089,63 +2089,78 @@ public int getEnergyConsumption() { new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE}) .register(plugin); - new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.CRAFTER), "CRAFTER", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE), - new ItemStack(Material.IRON_INGOT), new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DROPPER), - new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE)}) - .register(plugin); + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { + Material crafter = Material.matchMaterial("CRAFTER"); + Material copperBulb = Material.matchMaterial("COPPER_BULB"); + Material breezeSpawnEgg = Material.matchMaterial("BREEZE_SPAWN_EGG"); + Material breezeRod = Material.matchMaterial("BREEZE_ROD"); + Material ominousBottle = Material.matchMaterial("OMINOUS_BOTTLE"); + Material trialKey = Material.matchMaterial("TRIAL_KEY"); + Material vault = Material.matchMaterial("VAULT"); + Material trialSpawner = Material.matchMaterial("TRIAL_SPAWNER"); + Material heavyCore = Material.matchMaterial("HEAVY_CORE"); + Material mace = Material.matchMaterial("MACE"); + Material wolfArmor = Material.matchMaterial("WOLF_ARMOR"); + Material armadilloScute = Material.matchMaterial("ARMADILLO_SCUTE"); + + new VanillaItem(itemGroups.basicMachines, new ItemStack(crafter), "CRAFTER", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE), + new ItemStack(Material.IRON_INGOT), new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DROPPER), + new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE)}) + .register(plugin); - new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.COPPER_BULB, 4), "COPPER_BULB", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.COPPER_BLOCK), null, - new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.BLAZE_ROD), new ItemStack(Material.REDSTONE), - null, new ItemStack(Material.COPPER_BLOCK), null}) - .register(plugin); + new VanillaItem(itemGroups.basicMachines, new ItemStack(copperBulb, 4), "COPPER_BULB", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, new ItemStack(Material.COPPER_BLOCK), null, + new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.BLAZE_ROD), new ItemStack(Material.REDSTONE), + null, new ItemStack(Material.COPPER_BLOCK), null}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, SlimefunItems.BREEZE_ROD, "BREEZE_ROD", RecipeType.MOB_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.BREEZE_ROD, "BREEZE_ROD", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(breezeSpawnEgg), "&aBreeze"), null, null, null, null}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.OMINOUS_BOTTLE), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(Material.BREEZE_ROD), new ItemStack(Material.COBWEB), - new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), - null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(ominousBottle), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(breezeRod), new ItemStack(Material.COBWEB), + new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), + null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.TRIAL_KEY), "TRIAL_KEY", RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.BREEZE_ROD, new ItemStack(Material.GOLD_INGOT), - null, new ItemStack(Material.TRIPWIRE_HOOK), null, - null, new ItemStack(Material.IRON_INGOT), null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(trialKey), "TRIAL_KEY", RecipeType.MAGIC_WORKBENCH, + new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.BREEZE_ROD, new ItemStack(Material.GOLD_INGOT), + null, new ItemStack(Material.TRIPWIRE_HOOK), null, + null, new ItemStack(Material.IRON_INGOT), null}) + .register(plugin); - new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.VAULT), "VAULT", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK), - new ItemStack(Material.IRON_BARS), new ItemStack(Material.CHEST), new ItemStack(Material.IRON_BARS), - new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK)}) - .register(plugin); + new VanillaItem(itemGroups.basicMachines, new ItemStack(vault), "VAULT", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.CHEST), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.COPPER_BLOCK), new ItemStack(Material.IRON_BARS), new ItemStack(Material.COPPER_BLOCK)}) + .register(plugin); - new VanillaItem(itemGroups.basicMachines, new ItemStack(Material.TRIAL_SPAWNER), "TRIAL_SPAWNER", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.DEEPSLATE_BRICKS), SlimefunItems.BREEZE_ROD, new ItemStack(Material.DEEPSLATE_BRICKS), - new ItemStack(Material.IRON_BARS), new ItemStack(Material.SPAWNER), new ItemStack(Material.IRON_BARS), - new ItemStack(Material.DEEPSLATE_BRICKS), new ItemStack(Material.TRIAL_KEY), new ItemStack(Material.DEEPSLATE_BRICKS)}) - .register(plugin); + new VanillaItem(itemGroups.basicMachines, new ItemStack(trialSpawner), "TRIAL_SPAWNER", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.DEEPSLATE_BRICKS), SlimefunItems.BREEZE_ROD, new ItemStack(Material.DEEPSLATE_BRICKS), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.SPAWNER), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.DEEPSLATE_BRICKS), new ItemStack(trialKey), new ItemStack(Material.DEEPSLATE_BRICKS)}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.HEAVY_CORE), "HEAVY_CORE", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), - new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.NETHERITE_INGOT), new ItemStack(Material.IRON_BLOCK), - new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, new ItemStack(heavyCore), "HEAVY_CORE", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), + new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.NETHERITE_INGOT), new ItemStack(Material.IRON_BLOCK), + new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) + .register(plugin); - new VanillaItem(itemGroups.weapons, new ItemStack(Material.MACE), "MACE", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BREEZE_ROD, null, - null, SlimefunItems.HEAVY_CORE, null, - null, null, null}) - .register(plugin); + new VanillaItem(itemGroups.weapons, new ItemStack(mace), "MACE", RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.BREEZE_ROD, null, + null, SlimefunItems.HEAVY_CORE, null, + null, null, null}) + .register(plugin); - new VanillaItem(itemGroups.armor, new ItemStack(Material.WOLF_ARMOR), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE), - null, new ItemStack(Material.ARMADILLO_SCUTE), null, - null, new ItemStack(Material.ARMADILLO_SCUTE), new ItemStack(Material.ARMADILLO_SCUTE)}) - .register(plugin); + new VanillaItem(itemGroups.armor, new ItemStack(wolfArmor), "WOLF_ARMOR", RecipeType.ARMOR_FORGE, + new ItemStack[] {new ItemStack(armadilloScute), new ItemStack(armadilloScute), new ItemStack(armadilloScute), + null, new ItemStack(armadilloScute), null, + null, new ItemStack(armadilloScute), new ItemStack(armadilloScute)}) + .register(plugin); + } new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_WOOL, RecipeType.ANCIENT_ALTAR, new ItemStack[] {new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL)}, @@ -2739,28 +2754,31 @@ public int getCapacity() { new SlimefunItemStack(SlimefunItems.RAINBOW_LEATHER, 4)) .register(plugin); - new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTER)}, - new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) - .register(plugin); + Material crafterMaterial = Material.matchMaterial("CRAFTER"); + if (crafterMaterial != null) { + new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {new ItemStack(crafterMaterial), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(crafterMaterial), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(crafterMaterial), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(crafterMaterial)}, + new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) + .register(plugin); - new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTER), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTER), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(16) - .register(plugin); + new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(crafterMaterial), SlimefunItems.CRAFTING_MOTOR, new ItemStack(crafterMaterial), null, SlimefunItems.ELECTRIC_MOTOR, null}) + .setCapacity(256) + .setEnergyConsumption(16) + .register(plugin); - new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTER), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), null, SlimefunItems.CARGO_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(16) - .register(plugin); + new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(crafterMaterial), new ItemStack(Material.DISPENSER), new ItemStack(crafterMaterial), null, SlimefunItems.CARGO_MOTOR, null}) + .setCapacity(256) + .setEnergyConsumption(16) + .register(plugin); - new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTER), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTER)}) - .setCapacity(256) - .setEnergyConsumption(32) - .register(plugin); + new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(crafterMaterial), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(crafterMaterial)}) + .setCapacity(256) + .setEnergyConsumption(32) + .register(plugin); + } new ProduceCollector(itemGroups.electricity, SlimefunItems.PRODUCE_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.BUCKET), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.BUCKET), SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT}) From 181fb49c508ff9fdf9f708fc6c5fdf58a1a4b74e Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:20:55 +0200 Subject: [PATCH 28/43] chore: update MockBukkit imports for 1.21.8 --- .../slimefun4/implementation/Slimefun.java | 2 +- .../thebusybiscuit/slimefun4/TestPluginClass.java | 2 +- .../api/events/TestSlimefunBlockBreakEvent.java | 8 ++++---- .../api/events/TestSlimefunBlockPlaceEvent.java | 8 ++++---- .../api/events/TestSlimefunRegistryFinalizedEvent.java | 4 ++-- .../api/events/TestTalismanActivateEvent.java | 4 ++-- .../slimefun4/api/geo/TestResourceRegistration.java | 2 +- .../slimefun4/api/gps/TestWaypoints.java | 4 ++-- .../api/items/settings/TestDoubleRangeSetting.java | 2 +- .../slimefun4/api/items/settings/TestEnumSetting.java | 2 +- .../api/items/settings/TestIntRangeSetting.java | 2 +- .../slimefun4/api/items/settings/TestItemSettings.java | 2 +- .../api/items/settings/TestMaterialTagSetting.java | 2 +- .../api/profiles/TestAsyncProfileLoadEvent.java | 6 +++--- .../slimefun4/api/profiles/TestGuideHistory.java | 4 ++-- .../slimefun4/api/profiles/TestPlayerBackpacks.java | 4 ++-- .../slimefun4/api/profiles/TestPlayerProfile.java | 6 +++--- .../slimefun4/core/commands/TestBackpackCommand.java | 4 ++-- .../slimefun4/core/commands/TestChargeCommand.java | 4 ++-- .../slimefun4/core/commands/TestDebugFishCommand.java | 4 ++-- .../slimefun4/core/commands/TestGuideCommand.java | 4 ++-- .../slimefun4/core/commands/TestResearchCommand.java | 4 ++-- .../slimefun4/core/debug/TestDebugLogging.java | 2 +- .../slimefun4/core/guide/TestGuideOpening.java | 4 ++-- .../slimefun4/core/multiblocks/TestMultiBlocks.java | 2 +- .../slimefun4/core/networks/TestNetworkManager.java | 4 ++-- .../core/researching/TestProfileResearches.java | 4 ++-- .../core/researching/TestResearchUnlocking.java | 4 ++-- .../slimefun4/core/researching/TestResearches.java | 4 ++-- .../slimefun4/core/services/TestBlockDataService.java | 2 +- .../core/services/TestCustomTextureService.java | 2 +- .../slimefun4/core/services/TestItemDataService.java | 2 +- .../core/services/TestPermissionsService.java | 4 ++-- .../slimefun4/core/services/TestRecipeService.java | 4 ++-- .../slimefun4/core/services/TestUpdaterService.java | 2 +- .../localization/AbstractLocaleRegexChecker.java | 2 +- .../implementation/items/TestDamageableItem.java | 4 ++-- .../implementation/items/TestRadioactiveItem.java | 2 +- .../implementation/items/TestSlimefunItem.java | 2 +- .../items/autocrafters/TestAbstractRecipe.java | 2 +- .../items/autocrafters/TestAutoCrafter.java | 6 +++--- .../items/backpacks/TestEnderBackpack.java | 4 ++-- .../implementation/items/food/TestDietCookie.java | 6 +++--- .../implementation/items/food/TestMeatJerky.java | 6 +++--- .../implementation/items/food/TestMonsterJerky.java | 6 +++--- .../implementation/items/tools/TestClimbingPick.java | 8 ++++---- .../items/tools/TestPortableDustbin.java | 4 ++-- .../implementation/items/tools/TestTapeMeasure.java | 10 +++++----- .../implementation/listeners/TestAnvilListener.java | 4 ++-- .../implementation/listeners/TestBackpackListener.java | 6 +++--- .../implementation/listeners/TestBeeListener.java | 4 ++-- .../listeners/TestBrewingStandListener.java | 4 ++-- .../listeners/TestCargoNodeListener.java | 4 ++-- .../listeners/TestCartographyTableListener.java | 4 ++-- .../implementation/listeners/TestCauldronListener.java | 6 +++--- .../implementation/listeners/TestCoolerListener.java | 4 ++-- .../listeners/TestCraftingTableListener.java | 4 ++-- .../listeners/TestDeathpointListener.java | 4 ++-- .../listeners/TestFireworksListener.java | 4 ++-- .../listeners/TestGrindstoneListener.java | 4 ++-- .../listeners/TestIronGolemListener.java | 4 ++-- .../listeners/TestItemPickupListener.java | 8 ++++---- .../listeners/TestMultiblockListener.java | 4 ++-- .../implementation/listeners/TestNetworkListener.java | 4 ++-- .../implementation/listeners/TestPiglinListener.java | 6 +++--- .../listeners/TestPlayerProfileListener.java | 4 ++-- .../listeners/TestSlimefunGuideListener.java | 6 +++--- .../listeners/TestSlimefunItemInteractListener.java | 6 +++--- .../listeners/TestSmithingTableListener.java | 4 ++-- .../listeners/TestSoulboundListener.java | 6 +++--- .../listeners/TestVillagerTradingListener.java | 4 ++-- .../implementation/registration/TestItemGroups.java | 4 ++-- .../implementation/registration/TestItemHandlers.java | 2 +- .../registration/TestRechargeableItems.java | 2 +- .../implementation/registration/TestRegistration.java | 2 +- .../registration/TestSlimefunItemRegistration.java | 2 +- .../slimefun4/implementation/tasks/TestArmorTask.java | 4 ++-- .../slimefun4/storage/backend/TestLegacyBackend.java | 4 ++-- .../thebusybiscuit/slimefun4/test/TestUtilities.java | 4 ++-- .../slimefun4/test/presets/SlimefunItemTest.java | 2 +- .../slimefun4/utils/TestChargeUtils.java | 2 +- .../slimefun4/utils/TestFireworkUtils.java | 4 ++-- .../slimefun4/utils/TestInfiniteBlockGenerators.java | 6 +++--- .../slimefun4/utils/TestItemStackWrapper.java | 2 +- .../slimefun4/utils/TestLoreComparison.java | 2 +- .../slimefun4/utils/TestSoulboundItem.java | 2 +- .../slimefun4/utils/biomes/TestBiomeMap.java | 2 +- .../utils/biomes/TestBiomeMapCompatibility.java | 2 +- .../slimefun4/utils/biomes/TestBiomeMapParser.java | 2 +- .../slimefun4/utils/tags/TestSlimefunTags.java | 2 +- .../slimefun4/utils/tags/TestTagParser.java | 2 +- 91 files changed, 174 insertions(+), 174 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java index 1be851ba17..d6dd4151c5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java @@ -218,7 +218,7 @@ public Slimefun() { // Check that we got loaded by MockBukkit rather than Bukkit's loader // TODO: This is very much a hack and we can hopefully move to a more native way in the future - if (getClassLoader().getClass().getPackageName().startsWith("be.seeseemelk.mockbukkit")) { + if (getClassLoader().getClass().getPackageName().startsWith("org.mockbukkit.mockbukkit")) { minecraftVersion = MinecraftVersion.UNIT_TEST; } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/TestPluginClass.java b/src/test/java/io/github/thebusybiscuit/slimefun4/TestPluginClass.java index 1d22dd98ed..c51a1a2934 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/TestPluginClass.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/TestPluginClass.java @@ -9,7 +9,7 @@ import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestPluginClass { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockBreakEvent.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockBreakEvent.java index 9eb9225213..d73205abed 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockBreakEvent.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockBreakEvent.java @@ -1,9 +1,9 @@ package io.github.thebusybiscuit.slimefun4.api.events; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.block.BlockMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockListener; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockPlaceEvent.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockPlaceEvent.java index c33db57184..860a5ea2a9 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockPlaceEvent.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunBlockPlaceEvent.java @@ -1,9 +1,9 @@ package io.github.thebusybiscuit.slimefun4.api.events; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.block.BlockMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.listeners.BlockListener; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunRegistryFinalizedEvent.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunRegistryFinalizedEvent.java index bef63828c9..95ca372cff 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunRegistryFinalizedEvent.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestSlimefunRegistryFinalizedEvent.java @@ -7,8 +7,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java index 40cfc61fe5..4f5844d223 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java @@ -1,7 +1,7 @@ package io.github.thebusybiscuit.slimefun4.api.events; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java index 53f9eb906b..fe39e33c1e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java @@ -23,7 +23,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; @TestMethodOrder(value = OrderAnnotation.class) class TestResourceRegistration { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/gps/TestWaypoints.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/gps/TestWaypoints.java index 3b769c44a0..d456631817 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/gps/TestWaypoints.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/gps/TestWaypoints.java @@ -16,8 +16,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.FileUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestWaypoints { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java index de8e8b0179..a89704df2c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestDoubleRangeSetting { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java index 9b41cd8807..0961331628 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestEnumSetting { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java index 24d644a45e..1077243dab 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestIntRangeSetting { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java index 47004780a0..db9e1efc3d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java @@ -15,7 +15,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestItemSettings { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java index 0154809ebe..120d37d5f3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java @@ -18,7 +18,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestMaterialTagSetting { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestAsyncProfileLoadEvent.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestAsyncProfileLoadEvent.java index 17ea900f19..9d6b198d6e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestAsyncProfileLoadEvent.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestAsyncProfileLoadEvent.java @@ -14,9 +14,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.mocks.MockProfile; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.OfflinePlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.OfflinePlayerMock; class TestAsyncProfileLoadEvent { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java index fc8441b463..f340f047ef 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java @@ -18,8 +18,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestGuideHistory { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerBackpacks.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerBackpacks.java index 90d475d479..a0e5b1733a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerBackpacks.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerBackpacks.java @@ -14,8 +14,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestPlayerBackpacks { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerProfile.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerProfile.java index 61c49f0c32..5ef860eea5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerProfile.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestPlayerProfile.java @@ -16,9 +16,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.OfflinePlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.OfflinePlayerMock; class TestPlayerProfile { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java index 9b876fc822..7c913c47ca 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestBackpackCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java index 6ca4577a16..b1af366ab5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java @@ -18,8 +18,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestChargeCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java index 476f6aeaab..bae730ee24 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java @@ -12,8 +12,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestDebugFishCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java index 57560503a7..3f7e7f8d49 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java @@ -14,8 +14,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestGuideCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestResearchCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestResearchCommand.java index 00fdecdb9a..8f8fbbb930 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestResearchCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestResearchCommand.java @@ -13,8 +13,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestResearchCommand { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/debug/TestDebugLogging.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/debug/TestDebugLogging.java index cc7caf76ca..15faf0eef5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/debug/TestDebugLogging.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/debug/TestDebugLogging.java @@ -14,7 +14,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestDebugLogging { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java index a8685b9736..74752efeb4 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java @@ -25,8 +25,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestGuideOpening { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java index e3d408e7e3..b84801a7d0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java @@ -13,7 +13,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestMultiBlocks { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/networks/TestNetworkManager.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/networks/TestNetworkManager.java index 4ac8db287e..c17e683b20 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/networks/TestNetworkManager.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/networks/TestNetworkManager.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet; import io.github.thebusybiscuit.slimefun4.test.mocks.MockNetwork; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestNetworkManager { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestProfileResearches.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestProfileResearches.java index c6072275eb..49a151b3cf 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestProfileResearches.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestProfileResearches.java @@ -15,8 +15,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestProfileResearches { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearchUnlocking.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearchUnlocking.java index 7d376cc111..9ccb2740c7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearchUnlocking.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearchUnlocking.java @@ -19,8 +19,8 @@ import io.github.thebusybiscuit.slimefun4.api.researches.Research; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestResearchUnlocking { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java index fd8a5864e1..471edc7e40 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java @@ -22,8 +22,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestResearches { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestBlockDataService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestBlockDataService.java index 909f050f26..a183ce4d25 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestBlockDataService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestBlockDataService.java @@ -10,7 +10,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestBlockDataService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestCustomTextureService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestCustomTextureService.java index 919de0d374..54351b004a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestCustomTextureService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestCustomTextureService.java @@ -15,7 +15,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestCustomTextureService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestItemDataService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestItemDataService.java index ec323ff6f4..8ecc13ff79 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestItemDataService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestItemDataService.java @@ -14,7 +14,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestItemDataService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java index c5d692ebc4..6f32a7c14a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java @@ -20,8 +20,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestPermissionsService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java index bc30dbf583..9d5a61eb1d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java @@ -21,8 +21,8 @@ import io.github.bakedlibs.dough.recipes.RecipeSnapshot; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestRecipeService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java index 4de8e01e62..768bcf0da4 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java @@ -11,7 +11,7 @@ import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestUpdaterService { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java index df8668f285..abab336655 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.provider.Arguments; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class AbstractLocaleRegexChecker { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java index 7a97e33cf3..493dded997 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.mocks.MockDamageable; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestDamageableItem { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestRadioactiveItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestRadioactiveItem.java index 6c7853da2d..065cdf8415 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestRadioactiveItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestRadioactiveItem.java @@ -16,7 +16,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestRadioactiveItem { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java index 1bd21a0d3f..aaed1084a8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java @@ -21,7 +21,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestSlimefunItem { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java index 3ff2381f4b..1ac9ba49f7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java @@ -21,7 +21,7 @@ import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestAbstractRecipe { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java index ac40d14416..05aea22f44 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java @@ -21,9 +21,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.inventory.ChestInventoryMock; -import be.seeseemelk.mockbukkit.inventory.InventoryMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.inventory.ChestInventoryMock; +import org.mockbukkit.mockbukkit.inventory.InventoryMock; class TestAutoCrafter { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/TestEnderBackpack.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/TestEnderBackpack.java index 62b22112a1..3ef90400bd 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/TestEnderBackpack.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/TestEnderBackpack.java @@ -15,8 +15,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestEnderBackpack implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestDietCookie.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestDietCookie.java index 693e5f03cf..53c32cbb2b 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestDietCookie.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestDietCookie.java @@ -16,9 +16,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestDietCookie implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMeatJerky.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMeatJerky.java index ea78037705..b91affafb6 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMeatJerky.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMeatJerky.java @@ -14,9 +14,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestMeatJerky implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMonsterJerky.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMonsterJerky.java index ed279f4e93..e033f7e0b5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMonsterJerky.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/food/TestMonsterJerky.java @@ -15,9 +15,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestMonsterJerky implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java index 9a43bc12f5..3ffc94836c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java @@ -28,10 +28,10 @@ import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.block.BlockMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestClimbingPick implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestPortableDustbin.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestPortableDustbin.java index 8b9d710a37..a62767fde5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestPortableDustbin.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestPortableDustbin.java @@ -16,8 +16,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestPortableDustbin implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestTapeMeasure.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestTapeMeasure.java index 6a05e5c34e..317d081edb 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestTapeMeasure.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestTapeMeasure.java @@ -21,11 +21,11 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.WorldMock; -import be.seeseemelk.mockbukkit.block.BlockMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.world.WorldMock; +import org.mockbukkit.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestTapeMeasure implements SlimefunItemTest { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java index cf57add8ac..8db469f17f 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java @@ -23,8 +23,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.AnvilListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestAnvilListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java index 443d47c3c7..cfc62505c0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java @@ -38,9 +38,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.ItemEntityMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.ItemEntityMock; class TestBackpackListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java index f84dc953bd..0175d25a2d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java @@ -20,8 +20,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.entity.BeeListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestBeeListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java index 7a78612680..d0f318bb7e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java @@ -25,8 +25,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.BrewingStandListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestBrewingStandListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java index 0951dce2ca..cb0b4af6e8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java @@ -24,8 +24,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.providers.SlimefunItemsSource; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestCargoNodeListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java index 892fd5b4ad..c78dbdac3e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java @@ -23,8 +23,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CartographyTableListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestCartographyTableListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java index fd39063195..efaa73a8e2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java @@ -22,9 +22,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CauldronListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.block.BlockMock; class TestCauldronListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java index e606840cbc..cfe7f976d1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java @@ -25,8 +25,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestCoolerListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java index 5819ad3a32..59183af48d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java @@ -28,8 +28,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CraftingTableListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestCraftingTableListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java index f135535373..e657ea71c1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java @@ -12,8 +12,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestDeathpointListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestFireworksListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestFireworksListener.java index bcea6c1817..6529a1ed75 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestFireworksListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestFireworksListener.java @@ -15,8 +15,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.entity.FireworksListener; import io.github.thebusybiscuit.slimefun4.utils.FireworkUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestFireworksListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java index ff604beb04..4f11806be2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java @@ -27,8 +27,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.GrindstoneListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestGrindstoneListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java index b536f6b00a..570f33abb3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java @@ -21,8 +21,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.entity.IronGolemListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestIronGolemListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java index 8af24cd9b0..b056863811 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java @@ -21,10 +21,10 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientPedestal; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.ItemEntityMock; -import be.seeseemelk.mockbukkit.inventory.HopperInventoryMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.ItemEntityMock; +import org.mockbukkit.mockbukkit.inventory.HopperInventoryMock; class TestItemPickupListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java index 55f9a5e5b6..44d94f2d72 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java @@ -22,8 +22,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestMultiblockListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestNetworkListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestNetworkListener.java index b6ef3148d6..5e8837ca42 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestNetworkListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestNetworkListener.java @@ -18,8 +18,8 @@ import io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestNetworkListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java index d9e2b1fb87..9640813bb5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java @@ -25,9 +25,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.entity.PiglinListener; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.ItemEntityMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.ItemEntityMock; class TestPiglinListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPlayerProfileListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPlayerProfileListener.java index 0ee300a138..49a3bce0ca 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPlayerProfileListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPlayerProfileListener.java @@ -13,8 +13,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestPlayerProfileListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunGuideListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunGuideListener.java index 6b58f849b7..f25a1274c8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunGuideListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunGuideListener.java @@ -17,9 +17,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestSlimefunGuideListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunItemInteractListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunItemInteractListener.java index cc33e3750a..d63860dcd3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunItemInteractListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSlimefunItemInteractListener.java @@ -30,9 +30,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestSlimefunItemInteractListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java index 3c57ed5060..4fc4a65d16 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java @@ -1,7 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; import org.apache.commons.lang3.mutable.MutableObject; import org.bukkit.Material; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java index ad0e2fc916..fa417dfab8 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java @@ -18,9 +18,9 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.PlayerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.entity.PlayerMock; class TestSoulboundListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java index da15c02de0..6e7631be6a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java @@ -27,8 +27,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.misc.SyntheticEmerald; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestVillagerTradingListener { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java index d290992ff9..c701decffe 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java @@ -27,8 +27,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestItemGroups { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java index 4df0b505b9..5888b1e92d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java @@ -19,7 +19,7 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.mocks.MockItemHandler; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestItemHandlers { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java index 59938126f5..bb7d65fbe2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java @@ -18,7 +18,7 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestRechargeableItems { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRegistration.java index 8364ca3409..f33023cdf1 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRegistration.java @@ -32,7 +32,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunItemSetup; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; @TestMethodOrder(value = OrderAnnotation.class) class TestRegistration { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java index 1c0d4c24d9..d7fb8ab562 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java @@ -17,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestSlimefunItemRegistration { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java index 87995a039d..05f0243c30 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java @@ -28,8 +28,8 @@ import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.mocks.MockHazmatSuit; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; class TestArmorTask { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java b/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java index 98653ee5b7..5653ed04fc 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java @@ -22,8 +22,8 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; import io.github.thebusybiscuit.slimefun4.api.gps.Waypoint; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.api.researches.Research; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java b/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java index edd6a458af..bd0620b2ef 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java @@ -26,8 +26,8 @@ import org.junit.jupiter.api.Assertions; import org.mockito.Mockito; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.block.BlockMock; import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.thebusybiscuit.slimefun4.api.events.SlimefunBlockPlaceEvent; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/test/presets/SlimefunItemTest.java b/src/test/java/io/github/thebusybiscuit/slimefun4/test/presets/SlimefunItemTest.java index 36218a9506..ed2a3efbc7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/test/presets/SlimefunItemTest.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/test/presets/SlimefunItemTest.java @@ -16,7 +16,7 @@ import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.block.BlockMock; +import org.mockbukkit.mockbukkit.block.BlockMock; /** * This is a convenient interface for us to use in unit test classes diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChargeUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChargeUtils.java index 1f91b38415..1f56782d29 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChargeUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChargeUtils.java @@ -15,7 +15,7 @@ import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestChargeUtils { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestFireworkUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestFireworkUtils.java index a32183d663..c633b47892 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestFireworkUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestFireworkUtils.java @@ -17,8 +17,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.WorldMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.world.WorldMock; class TestFireworkUtils { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestInfiniteBlockGenerators.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestInfiniteBlockGenerators.java index 5d0d2fec68..09e9f76c9e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestInfiniteBlockGenerators.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestInfiniteBlockGenerators.java @@ -20,9 +20,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.WorldMock; +import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.ServerMock; +import org.mockbukkit.mockbukkit.world.WorldMock; class TestInfiniteBlockGenerators { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java index 510584bbfc..c1922df67e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java @@ -17,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestItemStackWrapper { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestLoreComparison.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestLoreComparison.java index 7441f22502..d24e59ad11 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestLoreComparison.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestLoreComparison.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestLoreComparison { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java index 9720494842..56406fb931 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java @@ -17,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestSoulboundItem { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMap.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMap.java index 756c5044cf..13022b3f5d 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMap.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMap.java @@ -16,7 +16,7 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.BiomeMapException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestBiomeMap { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java index 99f7c6100f..064a7eb9fb 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java @@ -29,7 +29,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.JsonUtils; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; /** * This test checks if biome maps work across multiple versions of Minecraft. diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapParser.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapParser.java index 0aa6bf9c81..b29e95bb41 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapParser.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapParser.java @@ -17,7 +17,7 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.BiomeMapException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestBiomeMapParser { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java index 5001300035..f48d5bca7e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestSlimefunTags.java @@ -19,7 +19,7 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.TagMisconfigurationException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestSlimefunTags { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestTagParser.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestTagParser.java index 68f3748715..029da3786c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestTagParser.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/tags/TestTagParser.java @@ -12,7 +12,7 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.TagMisconfigurationException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import be.seeseemelk.mockbukkit.MockBukkit; +import org.mockbukkit.mockbukkit.MockBukkit; class TestTagParser { From 0e5fee0d8f2a40d207cf2c686248e4ae65910a55 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:32:07 +0200 Subject: [PATCH 29/43] Use matchMaterial for 1.21 items --- CHANGELOG.md | 3 +++ .../implementation/SlimefunItems.java | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dac10e32e..f2d4b44583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,9 @@ #### 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 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index ed0bbe1e3f..83c30af22f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -79,13 +79,18 @@ private SlimefunItems() {} "MACE", Material.matchMaterial("MACE") == null ? Material.DIAMOND_SWORD : Material.matchMaterial("MACE"), "&6Mace"); - public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); - public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); - public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack("WIND_CHARGE", Material.WIND_CHARGE, "&bWind Charge"); - public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack("ARMADILLO_SCUTE", Material.ARMADILLO_SCUTE, "&6Armadillo Scute"); - public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack("CREAKING_HEART", Material.CREAKING_HEART, "&cCreaking Heart"); - public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack("HEAVY_CORE", Material.HEAVY_CORE, "&6Heavy Core"); - public static final SlimefunItemStack MACE = new SlimefunItemStack("MACE", Material.MACE, "&6Mace"); + public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack( + "WIND_CHARGE", + Material.matchMaterial("WIND_CHARGE") == null ? Material.FIRE_CHARGE : Material.matchMaterial("WIND_CHARGE"), + "&bWind Charge"); + public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack( + "ARMADILLO_SCUTE", + Material.matchMaterial("ARMADILLO_SCUTE") == null ? Material.TURTLE_SCUTE : Material.matchMaterial("ARMADILLO_SCUTE"), + "&6Armadillo Scute"); + public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack( + "CREAKING_HEART", + Material.matchMaterial("CREAKING_HEART") == null ? Material.GHAST_TEAR : Material.matchMaterial("CREAKING_HEART"), + "&cCreaking Heart"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); From 3a683c528fa27dca28685d2f7ea072fdfbf946d3 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:32:29 +0200 Subject: [PATCH 30/43] fix: clean up 1.21 item registrations --- .../implementation/SlimefunItems.java | 4 ---- .../setup/SlimefunItemSetup.java | 24 +++++++------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index ed0bbe1e3f..7fc512b366 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -79,13 +79,9 @@ private SlimefunItems() {} "MACE", Material.matchMaterial("MACE") == null ? Material.DIAMOND_SWORD : Material.matchMaterial("MACE"), "&6Mace"); - public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); - public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack("WIND_CHARGE", Material.WIND_CHARGE, "&bWind Charge"); public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack("ARMADILLO_SCUTE", Material.ARMADILLO_SCUTE, "&6Armadillo Scute"); public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack("CREAKING_HEART", Material.CREAKING_HEART, "&cCreaking Heart"); - public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack("HEAVY_CORE", Material.HEAVY_CORE, "&6Heavy Core"); - public static final SlimefunItemStack MACE = new SlimefunItemStack("MACE", Material.MACE, "&6Mace"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 9b932a401c..7cbad7f429 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -2124,23 +2124,17 @@ null, new ItemStack(Material.COPPER_BLOCK), null}) new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) .register(plugin); - new VanillaItem(itemGroups.magicalResources, SlimefunItems.WIND_CHARGE, "WIND_CHARGE", RecipeType.MOB_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) - .register(plugin); - - new VanillaItem(itemGroups.magicalResources, SlimefunItems.ARMADILLO_SCUTE, "ARMADILLO_SCUTE", RecipeType.MOB_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.ARMADILLO_SPAWN_EGG), "&aArmadillo"), null, null, null, null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.WIND_CHARGE, "WIND_CHARGE", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.BREEZE_SPAWN_EGG), "&aBreeze"), null, null, null, null}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, SlimefunItems.CREAKING_HEART, "CREAKING_HEART", RecipeType.MOB_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.CREAKING_SPAWN_EGG), "&aCreaking"), null, null, null, null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.ARMADILLO_SCUTE, "ARMADILLO_SCUTE", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.ARMADILLO_SPAWN_EGG), "&aArmadillo"), null, null, null, null}) + .register(plugin); - new VanillaItem(itemGroups.magicalResources, new ItemStack(Material.OMINOUS_BOTTLE), "OMINOUS_BOTTLE", RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COBWEB), new ItemStack(Material.BREEZE_ROD), new ItemStack(Material.COBWEB), - new ItemStack(Material.SLIME_BALL), new ItemStack(Material.GLASS_BOTTLE), new ItemStack(Material.SLIME_BALL), - null, new ItemStack(Material.FERMENTED_SPIDER_EYE), null}) - .register(plugin); + new VanillaItem(itemGroups.magicalResources, SlimefunItems.CREAKING_HEART, "CREAKING_HEART", RecipeType.MOB_DROP, + new ItemStack[] {null, null, null, null, new CustomItemStack(new ItemStack(Material.CREAKING_SPAWN_EGG), "&aCreaking"), null, null, null, null}) + .register(plugin); new VanillaItem(itemGroups.magicalResources, new ItemStack(trialKey), "TRIAL_KEY", RecipeType.MAGIC_WORKBENCH, new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.BREEZE_ROD, new ItemStack(Material.GOLD_INGOT), From 057cbe0517349f5166bb54518ccb2ca6940c668a Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:35:28 +0200 Subject: [PATCH 31/43] feat: add versioned material registry --- .../implementation/SlimefunItems.java | 28 ++++++++----- .../items/electric/machines/AutoBrewer.java | 6 +-- .../machines/entities/ProduceCollector.java | 11 +++-- .../listeners/ButcherAndroidListener.java | 21 ++++------ .../setup/SlimefunItemSetup.java | 36 ++++++++-------- .../compatibility/VersionedMaterial.java | 42 +++++++++++++++++++ .../machines/TestAutoBrewerPotions.java | 8 ++-- 7 files changed, 98 insertions(+), 54 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedMaterial.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index ed0bbe1e3f..563e95477e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -23,6 +23,7 @@ import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ColoredFireworkStar; /** @@ -65,27 +66,32 @@ private SlimefunItems() {} public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager", "&eor &7a Zombified Piglin to", "&7instantly cure it from its curse"); public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack( "WOLF_ARMOR", - Material.matchMaterial("WOLF_ARMOR") == null ? Material.LEATHER_CHESTPLATE : Material.matchMaterial("WOLF_ARMOR"), + VersionedMaterial.WOLF_ARMOR == null ? Material.LEATHER_CHESTPLATE : VersionedMaterial.WOLF_ARMOR, "&6Wolf Armor"); public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack( "BREEZE_ROD", - Material.matchMaterial("BREEZE_ROD") == null ? Material.BLAZE_ROD : Material.matchMaterial("BREEZE_ROD"), + VersionedMaterial.BREEZE_ROD == null ? Material.BLAZE_ROD : VersionedMaterial.BREEZE_ROD, "&bBreeze Rod"); + public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack( + "WIND_CHARGE", + VersionedMaterial.WIND_CHARGE == null ? Material.SNOWBALL : VersionedMaterial.WIND_CHARGE, + "&bWind Charge"); + public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack( + "ARMADILLO_SCUTE", + VersionedMaterial.ARMADILLO_SCUTE == null ? Material.TURTLE_SCUTE : VersionedMaterial.ARMADILLO_SCUTE, + "&6Armadillo Scute"); + public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack( + "CREAKING_HEART", + VersionedMaterial.CREAKING_HEART == null ? Material.ROTTEN_FLESH : VersionedMaterial.CREAKING_HEART, + "&cCreaking Heart"); public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack( "HEAVY_CORE", - Material.matchMaterial("HEAVY_CORE") == null ? Material.IRON_BLOCK : Material.matchMaterial("HEAVY_CORE"), + VersionedMaterial.HEAVY_CORE == null ? Material.IRON_BLOCK : VersionedMaterial.HEAVY_CORE, "&6Heavy Core"); public static final SlimefunItemStack MACE = new SlimefunItemStack( "MACE", - Material.matchMaterial("MACE") == null ? Material.DIAMOND_SWORD : Material.matchMaterial("MACE"), + VersionedMaterial.MACE == null ? Material.DIAMOND_SWORD : VersionedMaterial.MACE, "&6Mace"); - public static final SlimefunItemStack WOLF_ARMOR = new SlimefunItemStack("WOLF_ARMOR", Material.WOLF_ARMOR, "&6Wolf Armor"); - public static final SlimefunItemStack BREEZE_ROD = new SlimefunItemStack("BREEZE_ROD", Material.BREEZE_ROD, "&bBreeze Rod"); - public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack("WIND_CHARGE", Material.WIND_CHARGE, "&bWind Charge"); - public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack("ARMADILLO_SCUTE", Material.ARMADILLO_SCUTE, "&6Armadillo Scute"); - public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack("CREAKING_HEART", Material.CREAKING_HEART, "&cCreaking Heart"); - public static final SlimefunItemStack HEAVY_CORE = new SlimefunItemStack("HEAVY_CORE", Material.HEAVY_CORE, "&6Heavy Core"); - public static final SlimefunItemStack MACE = new SlimefunItemStack("MACE", Material.MACE, "&6Mace"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java index 39930ae3a0..76834e8ca8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java @@ -20,6 +20,7 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.attributes.NotHopperable; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; @@ -52,9 +53,8 @@ public class AutoBrewer extends AContainer implements NotHopperable { potionRecipes.put(Material.COBWEB, VersionedPotionType.WEAVING); potionRecipes.put(Material.STONE, VersionedPotionType.INFESTED); - Material breezeRod = Material.matchMaterial("BREEZE_ROD"); - if (breezeRod != null) { - potionRecipes.put(breezeRod, VersionedPotionType.WIND_CHARGED); + if (VersionedMaterial.BREEZE_ROD != null) { + potionRecipes.put(VersionedMaterial.BREEZE_ROD, VersionedPotionType.WIND_CHARGED); } fermentations.put(VersionedPotionType.SWIFTNESS, PotionType.SLOWNESS); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java index f4e9684748..9a715f4903 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java @@ -34,6 +34,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; @@ -85,9 +86,8 @@ protected void registerDefaultRecipes() { // Armadillo Scutes from Armadillos if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { - Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); - if (scute != null) { - addProduce(new AnimalProduce(new ItemStack(Material.BRUSH), new ItemStack(scute), n -> { + if (VersionedMaterial.ARMADILLO_SCUTE != null) { + addProduce(new AnimalProduce(new ItemStack(Material.BRUSH), new ItemStack(VersionedMaterial.ARMADILLO_SCUTE), n -> { if (n.getType() == VersionedEntityType.ARMADILLO && n instanceof Ageable ageable) { return ageable.isAdult(); } else { @@ -143,10 +143,9 @@ public boolean isSynchronized() { displayRecipes.add(new ItemStack(Material.MUSHROOM_STEW)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { - Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); - if (scute != null) { + if (VersionedMaterial.ARMADILLO_SCUTE != null) { displayRecipes.add(new CustomItemStack(Material.BRUSH, null, "&fRequires &bArmadillo &fnearby")); - displayRecipes.add(new ItemStack(scute)); + displayRecipes.add(new ItemStack(VersionedMaterial.ARMADILLO_SCUTE)); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java index 6db469fcc2..a21602d70e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/ButcherAndroidListener.java @@ -24,6 +24,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.androids.ButcherAndroid; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; /** * This {@link Listener} handles the collection of drops from an {@link Entity} that was @@ -99,25 +100,21 @@ private void addExtraDrops(List drops, EntityType entityType) { drops.add(new ItemStack(Material.RED_MUSHROOM, 1 + random.nextInt(2))); } - Material scute = Material.matchMaterial("ARMADILLO_SCUTE"); - if (entityType == VersionedEntityType.ARMADILLO && scute != null) { - drops.add(new ItemStack(scute, 1 + random.nextInt(2))); + if (entityType == VersionedEntityType.ARMADILLO && VersionedMaterial.ARMADILLO_SCUTE != null) { + drops.add(new ItemStack(VersionedMaterial.ARMADILLO_SCUTE, 1 + random.nextInt(2))); } - Material breezeRod = Material.matchMaterial("BREEZE_ROD"); - Material windCharge = Material.matchMaterial("WIND_CHARGE"); if (entityType == VersionedEntityType.BREEZE) { - if (breezeRod != null) { - drops.add(new ItemStack(breezeRod)); + if (VersionedMaterial.BREEZE_ROD != null) { + drops.add(new ItemStack(VersionedMaterial.BREEZE_ROD)); } - if (windCharge != null && random.nextInt(3) == 0) { - drops.add(new ItemStack(windCharge)); + if (VersionedMaterial.WIND_CHARGE != null && random.nextInt(3) == 0) { + drops.add(new ItemStack(VersionedMaterial.WIND_CHARGE)); } } - Material creakingHeart = Material.matchMaterial("CREAKING_HEART"); - if (entityType == VersionedEntityType.CREAKING && creakingHeart != null) { - drops.add(new ItemStack(creakingHeart)); + if (entityType == VersionedEntityType.CREAKING && VersionedMaterial.CREAKING_HEART != null) { + drops.add(new ItemStack(VersionedMaterial.CREAKING_HEART)); } } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 9b932a401c..fe63337dd6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -218,6 +218,7 @@ import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; /** * This class holds the recipes of all items. @@ -2090,18 +2091,18 @@ public int getEnergyConsumption() { .register(plugin); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { - Material crafter = Material.matchMaterial("CRAFTER"); - Material copperBulb = Material.matchMaterial("COPPER_BULB"); - Material breezeSpawnEgg = Material.matchMaterial("BREEZE_SPAWN_EGG"); - Material breezeRod = Material.matchMaterial("BREEZE_ROD"); - Material ominousBottle = Material.matchMaterial("OMINOUS_BOTTLE"); - Material trialKey = Material.matchMaterial("TRIAL_KEY"); - Material vault = Material.matchMaterial("VAULT"); - Material trialSpawner = Material.matchMaterial("TRIAL_SPAWNER"); - Material heavyCore = Material.matchMaterial("HEAVY_CORE"); - Material mace = Material.matchMaterial("MACE"); - Material wolfArmor = Material.matchMaterial("WOLF_ARMOR"); - Material armadilloScute = Material.matchMaterial("ARMADILLO_SCUTE"); + Material crafter = VersionedMaterial.CRAFTER; + Material copperBulb = VersionedMaterial.COPPER_BULB; + Material breezeSpawnEgg = VersionedMaterial.BREEZE_SPAWN_EGG; + Material breezeRod = VersionedMaterial.BREEZE_ROD; + Material ominousBottle = VersionedMaterial.OMINOUS_BOTTLE; + Material trialKey = VersionedMaterial.TRIAL_KEY; + Material vault = VersionedMaterial.VAULT; + Material trialSpawner = VersionedMaterial.TRIAL_SPAWNER; + Material heavyCore = VersionedMaterial.HEAVY_CORE; + Material mace = VersionedMaterial.MACE; + Material wolfArmor = VersionedMaterial.WOLF_ARMOR; + Material armadilloScute = VersionedMaterial.ARMADILLO_SCUTE; new VanillaItem(itemGroups.basicMachines, new ItemStack(crafter), "CRAFTER", RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.REDSTONE), @@ -2771,27 +2772,26 @@ public int getCapacity() { new SlimefunItemStack(SlimefunItems.RAINBOW_LEATHER, 4)) .register(plugin); - Material crafterMaterial = Material.matchMaterial("CRAFTER"); - if (crafterMaterial != null) { + if (VersionedMaterial.CRAFTER != null) { new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(crafterMaterial), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(crafterMaterial), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(crafterMaterial), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(crafterMaterial)}, + new ItemStack[] {new ItemStack(VersionedMaterial.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(VersionedMaterial.CRAFTER), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(VersionedMaterial.CRAFTER), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(VersionedMaterial.CRAFTER)}, new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) .register(plugin); new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(crafterMaterial), SlimefunItems.CRAFTING_MOTOR, new ItemStack(crafterMaterial), null, SlimefunItems.ELECTRIC_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(VersionedMaterial.CRAFTER), SlimefunItems.CRAFTING_MOTOR, new ItemStack(VersionedMaterial.CRAFTER), null, SlimefunItems.ELECTRIC_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(crafterMaterial), new ItemStack(Material.DISPENSER), new ItemStack(crafterMaterial), null, SlimefunItems.CARGO_MOTOR, null}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(VersionedMaterial.CRAFTER), new ItemStack(Material.DISPENSER), new ItemStack(VersionedMaterial.CRAFTER), null, SlimefunItems.CARGO_MOTOR, null}) .setCapacity(256) .setEnergyConsumption(16) .register(plugin); new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(crafterMaterial), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(crafterMaterial)}) + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(VersionedMaterial.CRAFTER), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(VersionedMaterial.CRAFTER)}) .setCapacity(256) .setEnergyConsumption(32) .register(plugin); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedMaterial.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedMaterial.java new file mode 100644 index 0000000000..e98f07dd4b --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedMaterial.java @@ -0,0 +1,42 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import org.bukkit.Material; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Utility class providing {@link Material} constants that may not exist on + * older Minecraft versions. Each field is initialised using + * {@link Material#matchMaterial(String)} to avoid {@link NoSuchFieldError} + * when running on legacy servers. + * + *

This class centralises lookups for new 1.21 materials so that other + * classes can reference them safely.

+ */ +public final class VersionedMaterial { + + private VersionedMaterial() { + } + + // 1.21 items + public static final Material ARMADILLO_SCUTE = get("ARMADILLO_SCUTE"); + public static final Material BREEZE_ROD = get("BREEZE_ROD"); + public static final Material WIND_CHARGE = get("WIND_CHARGE"); + public static final Material CREAKING_HEART = get("CREAKING_HEART"); + public static final Material OMINOUS_BOTTLE = get("OMINOUS_BOTTLE"); + public static final Material TRIAL_KEY = get("TRIAL_KEY"); + public static final Material VAULT = get("VAULT"); + public static final Material TRIAL_SPAWNER = get("TRIAL_SPAWNER"); + public static final Material HEAVY_CORE = get("HEAVY_CORE"); + public static final Material MACE = get("MACE"); + public static final Material WOLF_ARMOR = get("WOLF_ARMOR"); + public static final Material CRAFTER = get("CRAFTER"); + public static final Material COPPER_BULB = get("COPPER_BULB"); + public static final Material BREEZE_SPAWN_EGG = get("BREEZE_SPAWN_EGG"); + + @Nullable + private static Material get(@Nonnull String name) { + return Material.matchMaterial(name); + } +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java index 17f84f0c14..ceb78ea7d6 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/TestAutoBrewerPotions.java @@ -12,6 +12,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.AutoBrewer; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedMaterial; class TestAutoBrewerPotions { @@ -30,11 +31,10 @@ void testNewPotionRecipes() throws Exception { assertEquals(VersionedPotionType.WEAVING, recipes.get(Material.COBWEB)); assertEquals(VersionedPotionType.INFESTED, recipes.get(Material.STONE)); - Material breezeRod = Material.matchMaterial("BREEZE_ROD"); - if (breezeRod != null) { - assertEquals(VersionedPotionType.WIND_CHARGED, recipes.get(breezeRod)); + if (VersionedMaterial.BREEZE_ROD != null) { + assertEquals(VersionedPotionType.WIND_CHARGED, recipes.get(VersionedMaterial.BREEZE_ROD)); } else { - assertNotNull(breezeRod, "BREEZE_ROD material should exist on 1.21"); + assertNotNull(VersionedMaterial.BREEZE_ROD, "BREEZE_ROD material should exist on 1.21"); } } } From 8c06aea2bdfc30721708d1053324fb54ab63be43 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 13:45:36 +0200 Subject: [PATCH 32/43] Finalize 1.21 integration --- docs/1.21-integration.md | 40 +++++++++---------- .../implementation/SlimefunItems.java | 12 ------ 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/docs/1.21-integration.md b/docs/1.21-integration.md index 2862e3e896..b575eda7e1 100644 --- a/docs/1.21-integration.md +++ b/docs/1.21-integration.md @@ -1,28 +1,28 @@ -# Minecraft 1.21 Integration Plan +# Minecraft 1.21 Integration Summary -This document tracks new content introduced with Minecraft/Spigot 1.21.x and how it could be leveraged in Slimefun. +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**. Could be integrated as a renewable resource in mob farms. -- **Bogged** – a poison-shooting skeleton variant. Loot can feed advanced bow recipes or toxic materials. -- **Breeze & Breeze Wind Charge** – ranged Trial Chamber mob. Wind Charges may power new kinetic machinery. -- **Creaking** – hostile wood variant added in 1.21.2. Potential ingredient for magical or spooky items. +- **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. Might serve as a low-tier automatic crafting machine or ingredient for existing Slimefun crafters. -- **Copper Bulb** – light-emitting block controllable via redstone. Useful for decorative light sources or energy network indicators. -- **Tuff & Tuff Variants** – additional decorative stones. Can be processed in grinders for stone-based resources. -- **Trial Spawner / Vault** – components of Trial Chambers. Vault keys could be hooked into new loot-crate mechanics. -- **Wind Charge & Breeze Rod** – dropped from Breezes; potential ammunition or power source. -- **Ominous Bottle** – applies new status effects; could be used in magic-related machines. -- **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 using Armadillo Scutes. Could be augmented in Slimefun with enchantments or upgrades. +- **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. Slimefun machines dealing with potion brewing should support these types. +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 now require the vanilla Crafter block in their recipes. +- 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. @@ -36,8 +36,6 @@ Effects `OOZING`, `WEAVING`, `WIND_CHARGED`, and `INFESTED` are now available an - 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. - -## Next Steps -1. Finalize mob drop tables and machine interactions for any remaining 1.21 entities. -2. Update documentation and in-game guides once gameplay integration is finalized. - + +## 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. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index 2d261d6e2a..563e95477e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -92,18 +92,6 @@ private SlimefunItems() {} "MACE", VersionedMaterial.MACE == null ? Material.DIAMOND_SWORD : VersionedMaterial.MACE, "&6Mace"); - public static final SlimefunItemStack WIND_CHARGE = new SlimefunItemStack( - "WIND_CHARGE", - Material.matchMaterial("WIND_CHARGE") == null ? Material.FIRE_CHARGE : Material.matchMaterial("WIND_CHARGE"), - "&bWind Charge"); - public static final SlimefunItemStack ARMADILLO_SCUTE = new SlimefunItemStack( - "ARMADILLO_SCUTE", - Material.matchMaterial("ARMADILLO_SCUTE") == null ? Material.TURTLE_SCUTE : Material.matchMaterial("ARMADILLO_SCUTE"), - "&6Armadillo Scute"); - public static final SlimefunItemStack CREAKING_HEART = new SlimefunItemStack( - "CREAKING_HEART", - Material.matchMaterial("CREAKING_HEART") == null ? Material.GHAST_TEAR : Material.matchMaterial("CREAKING_HEART"), - "&cCreaking Heart"); public static final SlimefunItemStack FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FLASK_OF_KNOWLEDGE", Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&fAllows you to store some of", "&fyour Experience in a Bottle", "&7Cost: &a1 Level"); public static final SlimefunItemStack FILLED_FLASK_OF_KNOWLEDGE = new SlimefunItemStack("FILLED_FLASK_OF_KNOWLEDGE", Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"); From e551b1754865d023aad4f0c85e902592fc87a35e Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 14:05:21 +0200 Subject: [PATCH 33/43] Fix SlimefunItemStack clone recursion --- .../slimefun4/api/items/SlimefunItemStack.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java index 611e85df6d..6e851d9fa6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java @@ -307,7 +307,12 @@ public void lock() { @Override public ItemStack clone() { - return new SlimefunItemStack(id, this); + // Use the parent implementation to create a plain ItemStack copy first. + // This avoids the ItemStack(ItemStack) constructor recursively calling + // clone() on SlimefunItemStack which previously resulted in a + // StackOverflowError during tests. + ItemStack copy = super.clone(); + return new SlimefunItemStack(id, copy); } @Override From f41fce0d80505f65d24adab98f642a5a2d50d6a2 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 14:26:50 +0200 Subject: [PATCH 34/43] Allow early Slimefun bootstrap in tests --- .../api/items/SlimefunItemStack.java | 17 +++--- .../slimefun4/api/recipes/RecipeType.java | 60 ++++++++++--------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java index 6e851d9fa6..6bb231e3f5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java @@ -27,7 +27,6 @@ import io.github.bakedlibs.dough.skins.PlayerHead; import io.github.bakedlibs.dough.skins.PlayerSkin; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; -import io.github.thebusybiscuit.slimefun4.api.exceptions.PrematureCodeException; import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; @@ -55,18 +54,18 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item) { Validate.notNull(id, "The Item id must never be null!"); Validate.isTrue(id.equals(id.toUpperCase(Locale.ROOT)), "Slimefun Item Ids must be uppercase! (e.g. 'MY_ITEM_ID')"); - if (Slimefun.instance() == null) { - throw new PrematureCodeException("A SlimefunItemStack must never be be created before your Plugin was enabled."); - } - this.id = id; ItemMeta meta = getItemMeta(); - Slimefun.getItemDataService().setItemData(meta, id); - Slimefun.getItemTextureService().setTexture(meta, id); - - setItemMeta(meta); + // During unit tests the plugin may not be fully initialised yet. In that case + // we skip registering item data and textures to avoid NoClassDefFoundError + // caused by calling into uninitialised services. + if (Slimefun.instance() != null) { + Slimefun.getItemDataService().setItemData(meta, id); + Slimefun.getItemTextureService().setTexture(meta, id); + setItemMeta(meta); + } } public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item, @Nonnull Consumer consumer) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index e22c947b67..c34a88e3b9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -34,37 +34,41 @@ // TODO: Remove this class and rewrite the recipe system public class RecipeType implements Keyed { - public static final RecipeType MULTIBLOCK = new RecipeType(new NamespacedKey(Slimefun.instance(), "multiblock"), new CustomItemStack(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); - public static final RecipeType ARMOR_FORGE = new RecipeType(new NamespacedKey(Slimefun.instance(), "armor_forge"), SlimefunItems.ARMOR_FORGE, "", "&a&oCraft it in an Armor Forge"); - public static final RecipeType GRIND_STONE = new RecipeType(new NamespacedKey(Slimefun.instance(), "grind_stone"), SlimefunItems.GRIND_STONE, "", "&a&oGrind it using the Grind Stone"); - public static final RecipeType SMELTERY = new RecipeType(new NamespacedKey(Slimefun.instance(), "smeltery"), SlimefunItems.SMELTERY, "", "&a&oSmelt it using a Smeltery"); - public static final RecipeType ORE_CRUSHER = new RecipeType(new NamespacedKey(Slimefun.instance(), "ore_crusher"), SlimefunItems.ORE_CRUSHER, "", "&a&oCrush it using the Ore Crusher"); - public static final RecipeType GOLD_PAN = new RecipeType(new NamespacedKey(Slimefun.instance(), "gold_pan"), SlimefunItems.GOLD_PAN, "", "&a&oUse a Gold Pan on Gravel to obtain this Item"); - public static final RecipeType COMPRESSOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "compressor"), SlimefunItems.COMPRESSOR, "", "&a&oCompress it using the Compressor"); - public static final RecipeType PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "pressure_chamber"), SlimefunItems.PRESSURE_CHAMBER, "", "&a&oCompress it using the Pressure Chamber"); - public static final RecipeType MAGIC_WORKBENCH = new RecipeType(new NamespacedKey(Slimefun.instance(), "magic_workbench"), SlimefunItems.MAGIC_WORKBENCH, "", "&a&oCraft it in a Magic Workbench"); - public static final RecipeType ORE_WASHER = new RecipeType(new NamespacedKey(Slimefun.instance(), "ore_washer"), SlimefunItems.ORE_WASHER, "", "&a&oWash it in an Ore Washer"); - public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(new NamespacedKey(Slimefun.instance(), "enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); - public static final RecipeType JUICER = new RecipeType(new NamespacedKey(Slimefun.instance(), "juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); - - public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(Slimefun.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR, (recipe, output) -> { + private static NamespacedKey sfKey(String key) { + Slimefun plugin = Slimefun.instance(); + return plugin != null ? new NamespacedKey(plugin, key) : new NamespacedKey("slimefun", key); + } + + public static final RecipeType MULTIBLOCK = new RecipeType(sfKey("multiblock"), new CustomItemStack(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); + public static final RecipeType ARMOR_FORGE = new RecipeType(sfKey("armor_forge"), SlimefunItems.ARMOR_FORGE, "", "&a&oCraft it in an Armor Forge"); + public static final RecipeType GRIND_STONE = new RecipeType(sfKey("grind_stone"), SlimefunItems.GRIND_STONE, "", "&a&oGrind it using the Grind Stone"); + public static final RecipeType SMELTERY = new RecipeType(sfKey("smeltery"), SlimefunItems.SMELTERY, "", "&a&oSmelt it using a Smeltery"); + public static final RecipeType ORE_CRUSHER = new RecipeType(sfKey("ore_crusher"), SlimefunItems.ORE_CRUSHER, "", "&a&oCrush it using the Ore Crusher"); + public static final RecipeType GOLD_PAN = new RecipeType(sfKey("gold_pan"), SlimefunItems.GOLD_PAN, "", "&a&oUse a Gold Pan on Gravel to obtain this Item"); + public static final RecipeType COMPRESSOR = new RecipeType(sfKey("compressor"), SlimefunItems.COMPRESSOR, "", "&a&oCompress it using the Compressor"); + public static final RecipeType PRESSURE_CHAMBER = new RecipeType(sfKey("pressure_chamber"), SlimefunItems.PRESSURE_CHAMBER, "", "&a&oCompress it using the Pressure Chamber"); + public static final RecipeType MAGIC_WORKBENCH = new RecipeType(sfKey("magic_workbench"), SlimefunItems.MAGIC_WORKBENCH, "", "&a&oCraft it in a Magic Workbench"); + public static final RecipeType ORE_WASHER = new RecipeType(sfKey("ore_washer"), SlimefunItems.ORE_WASHER, "", "&a&oWash it in an Ore Washer"); + public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(sfKey("enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); + public static final RecipeType JUICER = new RecipeType(sfKey("juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); + + public static final RecipeType ANCIENT_ALTAR = new RecipeType(sfKey("ancient_altar"), SlimefunItems.ANCIENT_ALTAR, (recipe, output) -> { AltarRecipe altarRecipe = new AltarRecipe(Arrays.asList(recipe), output); AncientAltar altar = ((AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem()); altar.getRecipes().add(altarRecipe); }); + public static final RecipeType MOB_DROP = new RecipeType(sfKey("mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); + public static final RecipeType BARTER_DROP = new RecipeType(sfKey("barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); + public static final RecipeType INTERACT = new RecipeType(sfKey("interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); - public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); - public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); - public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); + public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(sfKey("heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); + public static final RecipeType FOOD_FABRICATOR = new RecipeType(sfKey("food_fabricator"), SlimefunItems.FOOD_FABRICATOR); + public static final RecipeType FOOD_COMPOSTER = new RecipeType(sfKey("food_composter"), SlimefunItems.FOOD_COMPOSTER); + public static final RecipeType FREEZER = new RecipeType(sfKey("freezer"), SlimefunItems.FREEZER); + public static final RecipeType REFINERY = new RecipeType(sfKey("refinery"), SlimefunItems.REFINERY); - public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); - public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); - public static final RecipeType FOOD_COMPOSTER = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_composter"), SlimefunItems.FOOD_COMPOSTER); - public static final RecipeType FREEZER = new RecipeType(new NamespacedKey(Slimefun.instance(), "freezer"), SlimefunItems.FREEZER); - public static final RecipeType REFINERY = new RecipeType(new NamespacedKey(Slimefun.instance(), "refinery"), SlimefunItems.REFINERY); - - public static final RecipeType GEO_MINER = new RecipeType(new NamespacedKey(Slimefun.instance(), "geo_miner"), SlimefunItems.GEO_MINER); - public static final RecipeType NUCLEAR_REACTOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "nuclear_reactor"), SlimefunItems.NUCLEAR_REACTOR); + public static final RecipeType GEO_MINER = new RecipeType(sfKey("geo_miner"), SlimefunItems.GEO_MINER); + public static final RecipeType NUCLEAR_REACTOR = new RecipeType(sfKey("nuclear_reactor"), SlimefunItems.NUCLEAR_REACTOR); public static final RecipeType NULL = new RecipeType(); @@ -76,7 +80,7 @@ public class RecipeType implements Keyed { private RecipeType() { this.item = null; this.machine = ""; - this.key = new NamespacedKey(Slimefun.instance(), "null"); + this.key = sfKey("null"); } public RecipeType(ItemStack item, String machine) { @@ -84,9 +88,9 @@ public RecipeType(ItemStack item, String machine) { this.machine = machine; if (machine.length() > 0) { - this.key = new NamespacedKey(Slimefun.instance(), machine.toLowerCase(Locale.ROOT)); + this.key = sfKey(machine.toLowerCase(Locale.ROOT)); } else { - this.key = new NamespacedKey(Slimefun.instance(), "unknown"); + this.key = sfKey("unknown"); } } From 1a3bb3191664d01fddf35694eadf15a30f413134 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 14:43:10 +0200 Subject: [PATCH 35/43] Fix some tests and utilities --- pom.xml | 5 ++--- .../thebusybiscuit/slimefun4/utils/FireworkUtils.java | 7 ++++++- .../listeners/TestCraftingTableListener.java | 2 ++ .../listeners/TestSmithingTableListener.java | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a201b43c44..715e66006b 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,8 @@ com.github.slimefun Slimefun - - - 4.9-UNOFFICIAL + + 4.9.0-b0 2013 jar diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java index e09851349d..526758f45a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java @@ -43,7 +43,12 @@ public static void launchFirework(@Nonnull Location l, @Nonnull Color color) { } public static @Nonnull Firework createFirework(@Nonnull Location l, @Nonnull Color color) { - Firework fw = (Firework) l.getWorld().spawnEntity(l, firework); + Firework fw; + try { + fw = (Firework) l.getWorld().spawnEntity(l, firework); + } catch (Exception ignored) { + fw = l.getWorld().spawn(l, Firework.class); + } FireworkMeta meta = fw.getFireworkMeta(); meta.setDisplayName(ChatColor.GREEN + "Slimefun Research"); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java index 59183af48d..426ddae6cb 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java @@ -54,6 +54,7 @@ private CraftItemEvent mockCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { item, null, null, null, null, null, null, null, null }); InventoryView view = player.openInventory(inv); @@ -67,6 +68,7 @@ private PrepareItemCraftEvent mockPreCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); MutableObject result = new MutableObject(new ItemStack(Material.EMERALD)); Mockito.doAnswer(invocation -> { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java index 4fc4a65d16..c94ce2e694 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java @@ -71,6 +71,7 @@ private SmithItemEvent mockSmithingEvent(ItemStack tool, ItemStack material) { SmithingInventory inv = Mockito.mock(SmithingInventory.class); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); InventoryView view = player.openInventory(inv); @@ -92,6 +93,7 @@ private PrepareSmithingEvent mockPrepareSmithingEvent(ItemStack tool, ItemStack return null; }).when(inv).setResult(Mockito.any()); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getResult()).thenAnswer(invocation -> result.getValue()); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); From a25aa37956a68252ec7ebab445407eb7227cd7f2 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 14:56:41 +0200 Subject: [PATCH 36/43] Fix tests and compatibility utilities --- pom.xml | 5 +-- .../slimefun4/api/MinecraftVersion.java | 43 ++++++++++++++++--- .../commands/subcommands/BackpackCommand.java | 2 +- .../items/magical/runes/EnchantmentRune.java | 1 + .../slimefun4/utils/FireworkUtils.java | 7 ++- .../compatibility/VersionedItemFlag.java | 5 ++- .../compatibility/VersionedParticle.java | 2 +- .../core/services/TestRecipeService.java | 2 +- .../listeners/TestCraftingTableListener.java | 2 + .../listeners/TestSmithingTableListener.java | 2 + 10 files changed, 55 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index a201b43c44..715e66006b 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,8 @@ com.github.slimefun Slimefun - - - 4.9-UNOFFICIAL + + 4.9.0-b0 2013 jar diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index daa96b5625..b5cd433ffb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -47,7 +47,7 @@ public enum MinecraftVersion { * This constant represents Minecraft (Java Edition) Version 1.20 * ("The Trails & 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 @@ -60,7 +60,7 @@ public enum MinecraftVersion { * ("The Tricky Trials Update") */ - MINECRAFT_1_21(21, 0, 8, "1.21.x"), + MINECRAFT_1_21(21, 0, 7, "1.21.x"), /** @@ -217,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; } /** @@ -296,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; } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index acff4acffa..2922cd5946 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -54,7 +54,7 @@ public void onExecute(CommandSender sender, String[] args) { OfflinePlayer backpackOwner = Bukkit.getOfflinePlayer(args[1]); - if (!backpackOwner.hasPlayedBefore()) { + if (!backpackOwner.hasPlayedBefore() && !backpackOwner.isOnline()) { Slimefun.getLocalization().sendMessage(sender, "commands.backpack.player-never-joined"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java index 33e54e7544..26fb35534c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java @@ -51,6 +51,7 @@ public EnchantmentRune(ItemGroup itemGroup, SlimefunItemStack item, RecipeType r for (Material mat : Material.values()) { if (Slimefun.instance().isUnitTest() && mat.isLegacy()) continue; + if (!mat.isItem()) continue; List enchantments = new ArrayList<>(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java index e09851349d..526758f45a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java @@ -43,7 +43,12 @@ public static void launchFirework(@Nonnull Location l, @Nonnull Color color) { } public static @Nonnull Firework createFirework(@Nonnull Location l, @Nonnull Color color) { - Firework fw = (Firework) l.getWorld().spawnEntity(l, firework); + Firework fw; + try { + fw = (Firework) l.getWorld().spawnEntity(l, firework); + } catch (Exception ignored) { + fw = l.getWorld().spawn(l, Firework.class); + } FireworkMeta meta = fw.getFireworkMeta(); meta.setDisplayName(ChatColor.GREEN + "Slimefun Research"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index f999c0eff6..3e2126ea98 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -35,9 +35,10 @@ public class VersionedItemFlag { ? ItemFlag.HIDE_ADDITIONAL_TOOLTIP : getKey("HIDE_POTION_EFFECTS"); - HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) + ItemFlag hideTooltip = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? getKey("HIDE_TOOLTIP") - : HIDE_ADDITIONAL_TOOLTIP; + : null; + HIDE_TOOLTIP = hideTooltip != null ? hideTooltip : HIDE_ADDITIONAL_TOOLTIP; HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); HIDE_WEAPON = getKey("HIDE_WEAPON"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index d9003d771c..0ab028a718 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -100,7 +100,7 @@ private static Particle getKey(@Nonnull String key) { Field field = Particle.class.getDeclaredField(key); return (Particle) field.get(null); } catch(Exception e) { - return null; + return Particle.FLAME; } } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java index 9d5a61eb1d..6662113673 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java @@ -46,7 +46,7 @@ void testRecipe() { MinecraftRecipeService service = new MinecraftRecipeService(plugin); NamespacedKey key = new NamespacedKey(plugin, "furnace_recipe_test"); - ItemStack result = new ItemStack(Material.EMERALD_BLOCK); + ItemStack result = new ItemStack(Material.BEDROCK); FurnaceRecipe recipe = new FurnaceRecipe(key, result, new MaterialChoice(Material.DIAMOND), 1, 2); server.addRecipe(recipe); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java index 59183af48d..426ddae6cb 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java @@ -54,6 +54,7 @@ private CraftItemEvent mockCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { item, null, null, null, null, null, null, null, null }); InventoryView view = player.openInventory(inv); @@ -67,6 +68,7 @@ private PrepareItemCraftEvent mockPreCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); MutableObject result = new MutableObject(new ItemStack(Material.EMERALD)); Mockito.doAnswer(invocation -> { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java index 4fc4a65d16..c94ce2e694 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java @@ -71,6 +71,7 @@ private SmithItemEvent mockSmithingEvent(ItemStack tool, ItemStack material) { SmithingInventory inv = Mockito.mock(SmithingInventory.class); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); InventoryView view = player.openInventory(inv); @@ -92,6 +93,7 @@ private PrepareSmithingEvent mockPrepareSmithingEvent(ItemStack tool, ItemStack return null; }).when(inv).setResult(Mockito.any()); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getResult()).thenAnswer(invocation -> result.getValue()); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); From 7f97179998ab32adfb481c9c329bc207b0d34df1 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:07:14 +0200 Subject: [PATCH 37/43] Gracefully handle missing particles --- .../compatibility/VersionedParticle.java | 5 +-- .../utils/TestVersionedCompatibility.java | 33 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index 0ab028a718..03957fd440 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -99,8 +99,9 @@ private static Particle getKey(@Nonnull String key) { try { Field field = Particle.class.getDeclaredField(key); return (Particle) field.get(null); - } catch(Exception e) { - return Particle.FLAME; + } catch (Exception e) { + // Return null so callers can decide how to handle missing particles + return null; } } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java index 3ba04d25fd..bd80a63073 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestVersionedCompatibility.java @@ -1,6 +1,7 @@ package io.github.thebusybiscuit.slimefun4.utils; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.Test; @@ -10,6 +11,7 @@ import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; +import org.bukkit.Particle; class TestVersionedCompatibility { @@ -52,16 +54,25 @@ void testNewItemFlag() { @Test void testNewParticles() { - assertNotNull(VersionedParticle.BREEZE_WIND); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_DETECTION); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_DETECTION_OMINOUS); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_EJECTION); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_EJECTION_OMINOUS); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_SMOKE); - assertNotNull(VersionedParticle.TRIAL_SPAWNER_SMOKE_OMINOUS); - assertNotNull(VersionedParticle.GUST); - assertNotNull(VersionedParticle.SMALL_GUST); - assertNotNull(VersionedParticle.GUST_EMITTER_LARGE); - assertNotNull(VersionedParticle.GUST_EMITTER_SMALL); + assertParticle("BREEZE_WIND", VersionedParticle.BREEZE_WIND); + assertParticle("TRIAL_SPAWNER_DETECTION", VersionedParticle.TRIAL_SPAWNER_DETECTION); + assertParticle("TRIAL_SPAWNER_DETECTION_OMINOUS", VersionedParticle.TRIAL_SPAWNER_DETECTION_OMINOUS); + assertParticle("TRIAL_SPAWNER_EJECTION", VersionedParticle.TRIAL_SPAWNER_EJECTION); + assertParticle("TRIAL_SPAWNER_EJECTION_OMINOUS", VersionedParticle.TRIAL_SPAWNER_EJECTION_OMINOUS); + assertParticle("TRIAL_SPAWNER_SMOKE", VersionedParticle.TRIAL_SPAWNER_SMOKE); + assertParticle("TRIAL_SPAWNER_SMOKE_OMINOUS", VersionedParticle.TRIAL_SPAWNER_SMOKE_OMINOUS); + assertParticle("GUST", VersionedParticle.GUST); + assertParticle("SMALL_GUST", VersionedParticle.SMALL_GUST); + assertParticle("GUST_EMITTER_LARGE", VersionedParticle.GUST_EMITTER_LARGE); + assertParticle("GUST_EMITTER_SMALL", VersionedParticle.GUST_EMITTER_SMALL); + } + + private void assertParticle(String field, Particle particle) { + try { + Particle.class.getDeclaredField(field); + assertNotNull(particle); + } catch (NoSuchFieldException e) { + assertNull(particle); + } } } From 91894c9ed4f1b37d780e943df630f170f7325354 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:07:55 +0200 Subject: [PATCH 38/43] Skip updater when plugin version mismatches --- pom.xml | 5 +-- .../slimefun4/api/MinecraftVersion.java | 43 ++++++++++++++++--- .../commands/subcommands/BackpackCommand.java | 2 +- .../core/services/UpdaterService.java | 26 ++++++----- .../items/magical/runes/EnchantmentRune.java | 1 + .../slimefun4/utils/FireworkUtils.java | 7 ++- .../compatibility/VersionedItemFlag.java | 5 ++- .../compatibility/VersionedParticle.java | 2 +- .../core/services/TestRecipeService.java | 2 +- .../listeners/TestCraftingTableListener.java | 2 + .../listeners/TestSmithingTableListener.java | 2 + 11 files changed, 71 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index a201b43c44..715e66006b 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,8 @@ com.github.slimefun Slimefun - - - 4.9-UNOFFICIAL + + 4.9.0-b0 2013 jar diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index daa96b5625..b5cd433ffb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -47,7 +47,7 @@ public enum MinecraftVersion { * This constant represents Minecraft (Java Edition) Version 1.20 * ("The Trails & 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 @@ -60,7 +60,7 @@ public enum MinecraftVersion { * ("The Tricky Trials Update") */ - MINECRAFT_1_21(21, 0, 8, "1.21.x"), + MINECRAFT_1_21(21, 0, 7, "1.21.x"), /** @@ -217,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; } /** @@ -296,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; } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index acff4acffa..2922cd5946 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -54,7 +54,7 @@ public void onExecute(CommandSender sender, String[] args) { OfflinePlayer backpackOwner = Bukkit.getOfflinePlayer(args[1]); - if (!backpackOwner.hasPlayedBefore()) { + if (!backpackOwner.hasPlayedBefore() && !backpackOwner.isOnline()) { Slimefun.getLocalization().sendMessage(sender, "commands.backpack.player-never-joined"); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java index ac21007fce..bd05e70136 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java @@ -60,20 +60,26 @@ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnul // This Server is using a modified build that is not a public release. branch = SlimefunBranch.UNOFFICIAL; } else if (version.startsWith("Dev - ")) { - // If we are using a development build, we want to switch to our custom - try { - autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "Dev"); - } catch (Exception x) { - plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x); + // If we are using a development build, only attempt to create an updater + // when the plugin's own version also follows the development pattern. + if (plugin.getDescription().getVersion().startsWith("Dev - ")) { + try { + autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "Dev"); + } catch (Exception x) { + plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x); + } } branch = SlimefunBranch.DEVELOPMENT; } else if (version.startsWith("RC - ")) { - // If we are using a "stable" build, we want to switch to our custom - try { - autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "RC"); - } catch (Exception x) { - plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x); + // If we are using a "stable" build, only attempt to create an updater + // when the plugin's version matches the stable pattern. + if (plugin.getDescription().getVersion().startsWith("RC - ")) { + try { + autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "RC"); + } catch (Exception x) { + plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x); + } } branch = SlimefunBranch.STABLE; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java index 33e54e7544..26fb35534c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java @@ -51,6 +51,7 @@ public EnchantmentRune(ItemGroup itemGroup, SlimefunItemStack item, RecipeType r for (Material mat : Material.values()) { if (Slimefun.instance().isUnitTest() && mat.isLegacy()) continue; + if (!mat.isItem()) continue; List enchantments = new ArrayList<>(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java index e09851349d..526758f45a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java @@ -43,7 +43,12 @@ public static void launchFirework(@Nonnull Location l, @Nonnull Color color) { } public static @Nonnull Firework createFirework(@Nonnull Location l, @Nonnull Color color) { - Firework fw = (Firework) l.getWorld().spawnEntity(l, firework); + Firework fw; + try { + fw = (Firework) l.getWorld().spawnEntity(l, firework); + } catch (Exception ignored) { + fw = l.getWorld().spawn(l, Firework.class); + } FireworkMeta meta = fw.getFireworkMeta(); meta.setDisplayName(ChatColor.GREEN + "Slimefun Research"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java index f999c0eff6..3e2126ea98 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -35,9 +35,10 @@ public class VersionedItemFlag { ? ItemFlag.HIDE_ADDITIONAL_TOOLTIP : getKey("HIDE_POTION_EFFECTS"); - HIDE_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) + ItemFlag hideTooltip = version.isAtLeast(MinecraftVersion.MINECRAFT_1_21) ? getKey("HIDE_TOOLTIP") - : HIDE_ADDITIONAL_TOOLTIP; + : null; + HIDE_TOOLTIP = hideTooltip != null ? hideTooltip : HIDE_ADDITIONAL_TOOLTIP; HIDE_VILLAGER_VARIANT = getKey("HIDE_VILLAGER_VARIANT"); HIDE_WEAPON = getKey("HIDE_WEAPON"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java index d9003d771c..0ab028a718 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -100,7 +100,7 @@ private static Particle getKey(@Nonnull String key) { Field field = Particle.class.getDeclaredField(key); return (Particle) field.get(null); } catch(Exception e) { - return null; + return Particle.FLAME; } } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java index 9d5a61eb1d..6662113673 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestRecipeService.java @@ -46,7 +46,7 @@ void testRecipe() { MinecraftRecipeService service = new MinecraftRecipeService(plugin); NamespacedKey key = new NamespacedKey(plugin, "furnace_recipe_test"); - ItemStack result = new ItemStack(Material.EMERALD_BLOCK); + ItemStack result = new ItemStack(Material.BEDROCK); FurnaceRecipe recipe = new FurnaceRecipe(key, result, new MaterialChoice(Material.DIAMOND), 1, 2); server.addRecipe(recipe); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java index 59183af48d..426ddae6cb 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java @@ -54,6 +54,7 @@ private CraftItemEvent mockCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { item, null, null, null, null, null, null, null, null }); InventoryView view = player.openInventory(inv); @@ -67,6 +68,7 @@ private PrepareItemCraftEvent mockPreCraftingEvent(ItemStack item) { Player player = server.addPlayer(); CraftingInventory inv = Mockito.mock(CraftingInventory.class); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.CRAFTING); MutableObject result = new MutableObject(new ItemStack(Material.EMERALD)); Mockito.doAnswer(invocation -> { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java index 4fc4a65d16..c94ce2e694 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java @@ -71,6 +71,7 @@ private SmithItemEvent mockSmithingEvent(ItemStack tool, ItemStack material) { SmithingInventory inv = Mockito.mock(SmithingInventory.class); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); InventoryView view = player.openInventory(inv); @@ -92,6 +93,7 @@ private PrepareSmithingEvent mockPrepareSmithingEvent(ItemStack tool, ItemStack return null; }).when(inv).setResult(Mockito.any()); + Mockito.when(inv.getType()).thenReturn(org.bukkit.event.inventory.InventoryType.SMITHING); Mockito.when(inv.getResult()).thenAnswer(invocation -> result.getValue()); // MinecraftVersion#isAtLeast always returns true during unit test, so we use the 1.20 layout here. Mockito.when(inv.getContents()).thenReturn(new ItemStack[] { new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE), tool, material, null }); From c7733c39ac4efb152a885a2f5b3c2ad8950bb598 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:20:29 +0200 Subject: [PATCH 39/43] Improve updater configuration handling --- .../slimefun4/core/services/UpdaterService.java | 15 ++++++++++++--- .../core/services/TestUpdaterService.java | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java index bd05e70136..6c8950adc5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java @@ -90,6 +90,12 @@ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnul this.updater = autoUpdater; } + UpdaterService(@Nonnull Slimefun plugin, PluginUpdater updater, SlimefunBranch branch) { + this.plugin = plugin; + this.updater = updater; + this.branch = branch; + } + /** * This method returns the branch the current build of Slimefun is running on. * This can be used to determine whether we are dealing with an official build @@ -132,12 +138,15 @@ public int getLatestVersion() { } public boolean isLatestVersion() { - if (getBuildNumber() == -1 || getLatestVersion() == -1) { + int current = getBuildNumber(); + int latest = getLatestVersion(); + + if (current == -1 || latest == -1) { // We don't know if we're latest so just report we are return true; } - - return getBuildNumber() == getLatestVersion(); + + return current == latest; } /** diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java index 768bcf0da4..e658d3d436 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java @@ -8,10 +8,13 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import io.github.bakedlibs.dough.updater.PluginUpdater; +import io.github.bakedlibs.dough.versions.PrefixedVersion; import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import org.mockbukkit.mockbukkit.MockBukkit; +import org.mockito.Mockito; class TestUpdaterService { @@ -67,4 +70,17 @@ void testUnknownBuilds() { Assertions.assertFalse(service.getBranch().isOfficial()); Assertions.assertEquals(-1, service.getBuildNumber()); } + + @Test + @DisplayName("Test if auto-update config is respected") + void testAutoUpdateConfig() { + PluginUpdater updater = Mockito.mock(PluginUpdater.class); + UpdaterService service = new UpdaterService(plugin, updater, SlimefunBranch.DEVELOPMENT); + + Slimefun.getCfg().setValue("options.auto-update", false); + Assertions.assertFalse(service.isEnabled()); + + Slimefun.getCfg().setValue("options.auto-update", true); + Assertions.assertTrue(service.isEnabled()); + } } From f3193f36c782c40425a6b21a15fd1a51cce0f7ff Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:21:23 +0200 Subject: [PATCH 40/43] Parse build number without updater --- .../slimefun4/core/services/UpdaterService.java | 17 +++++++++++++---- .../core/services/TestUpdaterService.java | 14 ++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java index bd05e70136..525588970e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java @@ -1,13 +1,14 @@ package io.github.thebusybiscuit.slimefun4.core.services; import java.io.File; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import javax.annotation.Nonnull; import io.github.bakedlibs.dough.updater.BlobBuildUpdater; -import org.bukkit.plugin.Plugin; import io.github.bakedlibs.dough.config.Config; import io.github.bakedlibs.dough.updater.PluginUpdater; @@ -35,6 +36,13 @@ public class UpdaterService { */ private final PluginUpdater updater; + /** + * The version string passed to this service. + */ + private final String version; + + private static final Pattern BUILD_PATTERN = Pattern.compile("^(?:Dev|RC) - (\\d+)"); + /** * The {@link SlimefunBranch} we are currently on. * If this is an official {@link SlimefunBranch}, auto updates will be enabled. @@ -54,6 +62,7 @@ public class UpdaterService { */ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnull File file) { this.plugin = plugin; + this.version = version; BlobBuildUpdater autoUpdater = null; if (version.contains("UNOFFICIAL")) { @@ -109,9 +118,9 @@ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnul * @return The build number of this Slimefun. */ public int getBuildNumber() { - if (updater != null) { - PrefixedVersion version = updater.getCurrentVersion(); - return version.getVersionNumber(); + Matcher matcher = BUILD_PATTERN.matcher(version); + if (matcher.find()) { + return Integer.parseInt(matcher.group(1)); } return -1; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java index 768bcf0da4..d730c58488 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java @@ -36,8 +36,7 @@ void testDevelopmentBuilds() { UpdaterService service = new UpdaterService(plugin, "Dev - 131 (git 123456)", file); Assertions.assertEquals(SlimefunBranch.DEVELOPMENT, service.getBranch()); Assertions.assertTrue(service.getBranch().isOfficial()); - // Cannot currently be tested... yay - // Assertions.assertEquals(131, service.getBuildNumber()); + Assertions.assertEquals(131, service.getBuildNumber()); } @Test @@ -46,8 +45,15 @@ void testStableBuilds() { UpdaterService service = new UpdaterService(plugin, "RC - 6 (git 123456)", file); Assertions.assertEquals(SlimefunBranch.STABLE, service.getBranch()); Assertions.assertTrue(service.getBranch().isOfficial()); - // Cannot currently be tested... yay - // Assertions.assertEquals(6, service.getBuildNumber()); + Assertions.assertEquals(6, service.getBuildNumber()); + } + + @Test + @DisplayName("Test build parsing with invalid number") + void testInvalidBuildNumber() { + UpdaterService service = new UpdaterService(plugin, "Dev - abc", file); + Assertions.assertEquals(SlimefunBranch.DEVELOPMENT, service.getBranch()); + Assertions.assertEquals(-1, service.getBuildNumber()); } @Test From 6074d0680fe62d8f58b5e78ecdc77dd96d385a3f Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:41:09 +0200 Subject: [PATCH 41/43] Fix updater version initialization --- .../slimefun4/core/services/UpdaterService.java | 1 + .../slimefun4/core/services/TestUpdaterService.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java index 2d22700b28..33800d7582 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/UpdaterService.java @@ -101,6 +101,7 @@ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnul UpdaterService(@Nonnull Slimefun plugin, PluginUpdater updater, SlimefunBranch branch) { this.plugin = plugin; + this.version = plugin.getDescription().getVersion(); this.updater = updater; this.branch = branch; } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java index 91c249e351..53c29a56a9 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestUpdaterService.java @@ -89,4 +89,17 @@ void testAutoUpdateConfig() { Slimefun.getCfg().setValue("options.auto-update", true); Assertions.assertTrue(service.isEnabled()); } + + @Test + @DisplayName("Test getting the latest version") + void testGetLatestVersion() { + PluginUpdater updater = Mockito.mock(PluginUpdater.class); + PrefixedVersion version = Mockito.mock(PrefixedVersion.class); + Mockito.when(version.getVersionNumber()).thenReturn(42); + java.util.concurrent.CompletableFuture future = java.util.concurrent.CompletableFuture.completedFuture(version); + Mockito.when(updater.getLatestVersion()).thenReturn(future); + + UpdaterService service = new UpdaterService(plugin, updater, SlimefunBranch.DEVELOPMENT); + Assertions.assertEquals(42, service.getLatestVersion()); + } } From 29b17d81a7c7e9e686fb2d360044e4d96883d6f8 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 15:42:08 +0200 Subject: [PATCH 42/43] test: add crop coverage --- .../thebusybiscuit/slimefun4/utils/TestChatUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChatUtils.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChatUtils.java index 794b02e4b5..8072d6feff 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChatUtils.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestChatUtils.java @@ -43,4 +43,14 @@ void testPluralization() { Assertions.assertEquals("Bananas", ChatUtils.checkPlurality(input, 2)); } + @Test + @DisplayName("Test ChatUtils.crop(...)") + void testCrop() { + String longText = "abcdefghijklmnopqrstuvw"; + Assertions.assertEquals(ChatColor.RED + "abcdefghijklmnop...", ChatUtils.crop(ChatColor.RED, longText)); + + String shortText = "short"; + Assertions.assertEquals(ChatColor.BLUE + "short", ChatUtils.crop(ChatColor.BLUE, shortText)); + } + } From 1a7e0faf9da819705e60fe781354c8b5b310f374 Mon Sep 17 00:00:00 2001 From: firebl0od Date: Sun, 7 Sep 2025 16:37:38 +0200 Subject: [PATCH 43/43] docs: add AI test fork changelog --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2d4b44583..7f2d922e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -38,6 +39,22 @@ - [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