diff --git a/src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java b/src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java index e447300d6ef..2af432ce6d3 100644 --- a/src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java +++ b/src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java @@ -312,6 +312,16 @@ public static boolean isAir(Material type) { // cherry if (Skript.isRunningMinecraft(1, 19, 4)) TREE_TO_SAPLING_MAP.put(TreeType.CHERRY, Material.CHERRY_SAPLING); + + // mega pine (2x2 spruce tree with minimal leaves at top) + if (Skript.isRunningMinecraft(1, 20, 5)) + TREE_TO_SAPLING_MAP.put(TreeType.MEGA_PINE, Material.SPRUCE_SAPLING); + + // pale oak + if (Skript.isRunningMinecraft(1, 21, 3)) { + TREE_TO_SAPLING_MAP.put(TreeType.PALE_OAK, Material.PALE_OAK_SAPLING); + TREE_TO_SAPLING_MAP.put(TreeType.PALE_OAK_CREAKING, Material.PALE_OAK_SAPLING); + } } public static Material getTreeSapling(TreeType treeType) { diff --git a/src/test/java/org/skriptlang/skript/test/tests/regression/MissingTreeSaplingMapEntriesTest.java b/src/test/java/org/skriptlang/skript/test/tests/regression/MissingTreeSaplingMapEntriesTest.java new file mode 100644 index 00000000000..371c03a48ba --- /dev/null +++ b/src/test/java/org/skriptlang/skript/test/tests/regression/MissingTreeSaplingMapEntriesTest.java @@ -0,0 +1,17 @@ +package org.skriptlang.skript.test.tests.regression; + +import ch.njol.skript.bukkitutil.ItemUtils; +import org.bukkit.TreeType; +import org.junit.Assert; +import org.junit.Test; + +public class MissingTreeSaplingMapEntriesTest { + + @Test + public void test() { + for (TreeType type : TreeType.values()) { + Assert.assertNotNull("Tree type " + type + " has no mapped sapling in ItemUtils#getTreeSapling().", ItemUtils.getTreeSapling(type)); + } + } + +}