@@ -32,6 +32,7 @@ public class Bukkit_v1_21 extends Bukkit_v1_20 {
3232
3333 public static Set <Material > COPPER_CHESTS = new HashSet <>(Arrays .asList ());
3434 public static Set <Material > SHELVES = new HashSet <>(Arrays .asList ());
35+ public static Set <Material > BUNDLES = new HashSet <>(Arrays .asList ());
3536
3637 /**
3738 * Initializes the Bukkit_v1_21 adapter with 1.21-specific block groups and mappings.
@@ -40,6 +41,7 @@ public class Bukkit_v1_21 extends Bukkit_v1_20 {
4041 public Bukkit_v1_21 () {
4142 initializeBlockGroups ();
4243 initializeTrapdoorBlocks ();
44+ initializeBundles ();
4345 BlockGroup .INTERACT_BLOCKS .addAll (copperChestMaterials ());
4446 BlockGroup .CONTAINERS .addAll (copperChestMaterials ());
4547 BlockGroup .UPDATE_STATE .addAll (copperChestMaterials ());
@@ -73,6 +75,20 @@ private void initializeTrapdoorBlocks() {
7375 }
7476 }
7577
78+ /**
79+ * Initializes the bundles group to enable the ability to roll back dyed bundles correctly.
80+ * It needs to check whether dyed bundles exist because they were added in 1.21.2.
81+ */
82+ public void initializeBundles (){
83+ if (BUNDLES .isEmpty ()) {
84+ Material bundle = Material .getMaterial ("RED_BUNDLE" );
85+ if (bundle != null ) {
86+ BUNDLES .addAll (Tag .ITEMS_BUNDLES .getValues ());
87+ }
88+ BUNDLES .add (Material .BUNDLE );
89+ }
90+ }
91+
7692 /**
7793 * Helper method to add a block to a block group if it's not already present.
7894 *
@@ -190,6 +206,12 @@ public boolean isShelf(Material material) {
190206 return SHELVES .contains (material );
191207 }
192208
209+ @ Override
210+ public boolean isBundle (Material material ) {
211+ return Tag .ITEMS_BUNDLES .getValues ().contains (material );
212+ }
213+
214+
193215 @ Override
194216 public Set <Material > copperChestMaterials () {
195217 if (COPPER_CHESTS .isEmpty ()) {
0 commit comments