2929import io .github .pylonmc .pylon .core .datatypes .PylonSerializers ;
3030import io .github .pylonmc .pylon .core .item .PylonItem ;
3131import io .github .pylonmc .pylon .core .item .builder .ItemStackBuilder ;
32+ import io .github .pylonmc .pylon .core .item .builder .PylonItemStackBuilder ;
3233import io .github .pylonmc .pylon .core .recipe .DisplayRecipeType ;
3334import io .github .pylonmc .pylon .core .recipe .RecipeType ;
35+ import io .github .pylonmc .pylon .core .util .ToolType ;
3436import io .papermc .paper .datacomponent .DataComponentTypes ;
3537import io .papermc .paper .datacomponent .item .*;
3638import io .papermc .paper .datacomponent .item .consumable .ConsumeEffect ;
@@ -372,88 +374,88 @@ private BaseItems() {
372374 //</editor-fold>
373375
374376 //<editor-fold desc="Hammers" defaultstate=collapsed>
375- public static final ItemStack HAMMER_STONE = ItemStackBuilder . pylonItem (Material .STONE_PICKAXE , BaseKeys .HAMMER_STONE )
376- .weapon (). attackKnockback (). noTool (). durability ().build ();
377+ public static final ItemStack HAMMER_STONE = PylonItemStackBuilder . weapon (Material .STONE_PICKAXE , BaseKeys .HAMMER_STONE , true , true , false )
378+ .noTool ().build ();
377379 static {
378380 PylonItem .register (Hammer .class , HAMMER_STONE );
379381 BasePages .TOOLS .addItem (HAMMER_STONE );
380382 }
381383
382- public static final ItemStack HAMMER_IRON = ItemStackBuilder . pylonItem (Material .IRON_PICKAXE , BaseKeys .HAMMER_IRON )
383- .weapon (). attackKnockback (). noTool (). durability ().build ();
384+ public static final ItemStack HAMMER_IRON = PylonItemStackBuilder . weapon (Material .STONE_PICKAXE , BaseKeys .HAMMER_IRON , true , true , false )
385+ .noTool ().build ();
384386 static {
385387 PylonItem .register (Hammer .class , HAMMER_IRON );
386388 BasePages .TOOLS .addItem (HAMMER_IRON );
387389 }
388390
389- public static final ItemStack HAMMER_DIAMOND = ItemStackBuilder . pylonItem (Material .DIAMOND_PICKAXE , BaseKeys .HAMMER_DIAMOND )
390- .weapon (). attackKnockback (). noTool (). durability ().build ();
391+ public static final ItemStack HAMMER_DIAMOND = PylonItemStackBuilder . weapon (Material .DIAMOND_PICKAXE , BaseKeys .HAMMER_DIAMOND , true , true , false )
392+ .noTool ().build ();
391393 static {
392394 PylonItem .register (Hammer .class , HAMMER_DIAMOND );
393395 BasePages .TOOLS .addItem (HAMMER_DIAMOND );
394396 }
395397 //</editor-fold>
396398
397399 //<editor-fold desc="Bronze tools/armour" defaultstate=collapsed>
398- public static final ItemStack BRONZE_SWORD = ItemStackBuilder . pylonItem (Material .GOLDEN_SWORD , BaseKeys .BRONZE_SWORD )
399- .weapon (). durability (). build ();
400+ public static final ItemStack BRONZE_SWORD = PylonItemStackBuilder . weapon (Material .GOLDEN_SWORD , BaseKeys .BRONZE_SWORD , true , false , false )
401+ .build ();
400402 static {
401403 PylonItem .register (PylonItem .class , BRONZE_SWORD );
402404 BasePages .COMBAT .addItem (BRONZE_SWORD );
403405 }
404406
405- public static final ItemStack BRONZE_AXE = ItemStackBuilder . pylonItem (Material .GOLDEN_AXE , BaseKeys .BRONZE_AXE )
406- .axe (). weapon ( true ). durability (). build ();
407+ public static final ItemStack BRONZE_AXE = PylonItemStackBuilder . toolWeapon (Material .GOLDEN_AXE , BaseKeys .BRONZE_AXE , ToolType . AXE , true , false , true )
408+ .build ();
407409 static {
408410 PylonItem .register (PylonItem .class , BRONZE_AXE );
409411 BasePages .TOOLS .addItem (BRONZE_AXE );
410412 }
411413
412- public static final ItemStack BRONZE_PICKAXE = ItemStackBuilder . pylonItem (Material .GOLDEN_PICKAXE , BaseKeys .BRONZE_PICKAXE )
413- .pickaxe (). weapon (). durability (). build ();
414+ public static final ItemStack BRONZE_PICKAXE = PylonItemStackBuilder . toolWeapon (Material .GOLDEN_PICKAXE , BaseKeys .BRONZE_PICKAXE , ToolType . PICKAXE , true , false , false )
415+ .build ();
414416 static {
415417 PylonItem .register (PylonItem .class , BRONZE_PICKAXE );
416418 BasePages .TOOLS .addItem (BRONZE_PICKAXE );
417419 }
418420
419- public static final ItemStack BRONZE_SHOVEL = ItemStackBuilder . pylonItem (Material .GOLDEN_SHOVEL , BaseKeys .BRONZE_SHOVEL )
420- .shovel (). weapon (). durability (). build ();
421+ public static final ItemStack BRONZE_SHOVEL = PylonItemStackBuilder . toolWeapon (Material .GOLDEN_SHOVEL , BaseKeys .BRONZE_SHOVEL , ToolType . SHOVEL , true , false , false )
422+ .build ();
421423 static {
422424 PylonItem .register (PylonItem .class , BRONZE_SHOVEL );
423425 BasePages .TOOLS .addItem (BRONZE_SHOVEL );
424426 }
425427
426- public static final ItemStack BRONZE_HOE = ItemStackBuilder . pylonItem (Material .GOLDEN_HOE , BaseKeys .BRONZE_HOE )
427- .hoe (). weapon (). durability (). build ();
428+ public static final ItemStack BRONZE_HOE = PylonItemStackBuilder . toolWeapon (Material .GOLDEN_HOE , BaseKeys .BRONZE_HOE , ToolType . HOE , true , false , false )
429+ .build ();
428430 static {
429431 PylonItem .register (PylonItem .class , BRONZE_HOE );
430432 BasePages .TOOLS .addItem (BRONZE_HOE );
431433 }
432434 //</editor-fold>
433435
434- public static final ItemStack BRONZE_HELMET = ItemStackBuilder . pylonItem (Material .GOLDEN_HELMET , BaseKeys .BRONZE_HELMET )
435- .helmet (). durability (). build ();
436+ public static final ItemStack BRONZE_HELMET = PylonItemStackBuilder . helmet (Material .GOLDEN_HELMET , BaseKeys .BRONZE_HELMET , true )
437+ .build ();
436438 static {
437439 PylonItem .register (BronzeArmor .class , BRONZE_HELMET );
438440 BasePages .ARMOUR .addItem (BRONZE_HELMET );
439441 }
440442
441- public static final ItemStack BRONZE_CHESTPLATE = ItemStackBuilder . pylonItem (Material .GOLDEN_CHESTPLATE , BaseKeys .BRONZE_CHESTPLATE )
442- .chestPlate (). durability (). build ();
443+ public static final ItemStack BRONZE_CHESTPLATE = PylonItemStackBuilder . chestPlate (Material .GOLDEN_CHESTPLATE , BaseKeys .BRONZE_CHESTPLATE , true )
444+ .build ();
443445 static {
444446 PylonItem .register (BronzeArmor .class , BRONZE_CHESTPLATE );
445447 BasePages .ARMOUR .addItem (BRONZE_CHESTPLATE );
446448 }
447449
448- public static final ItemStack BRONZE_LEGGINGS = ItemStackBuilder . pylonItem (Material .GOLDEN_LEGGINGS , BaseKeys .BRONZE_LEGGINGS )
449- .leggings (). durability (). build ();
450+ public static final ItemStack BRONZE_LEGGINGS = PylonItemStackBuilder . leggings (Material .GOLDEN_LEGGINGS , BaseKeys .BRONZE_LEGGINGS , true )
451+ .build ();
450452 static {
451453 PylonItem .register (BronzeArmor .class , BRONZE_LEGGINGS );
452454 BasePages .ARMOUR .addItem (BRONZE_LEGGINGS );
453455 }
454456
455- public static final ItemStack BRONZE_BOOTS = ItemStackBuilder . pylonItem (Material .GOLDEN_BOOTS , BaseKeys .BRONZE_BOOTS )
456- .boots (). durability (). build ();
457+ public static final ItemStack BRONZE_BOOTS = PylonItemStackBuilder . boots (Material .GOLDEN_BOOTS , BaseKeys .BRONZE_BOOTS , true )
458+ .build ();
457459 static {
458460 PylonItem .register (BronzeArmor .class , BRONZE_BOOTS );
459461 BasePages .ARMOUR .addItem (BRONZE_BOOTS );
@@ -606,14 +608,16 @@ private BaseItems() {
606608 //</editor-fold>
607609
608610 public static final ItemStack LUMBER_AXE = ItemStackBuilder .pylonItem (Material .WOODEN_AXE , BaseKeys .LUMBER_AXE )
609- .durability ().build ();
611+ .durability (Settings .get (BaseKeys .LUMBER_AXE ).getOrThrow ("durability" , ConfigAdapter .INT ))
612+ .build ();
610613 static {
611614 PylonItem .register (LumberAxe .class , LUMBER_AXE );
612615 BasePages .TOOLS .addItem (LUMBER_AXE );
613616 }
614617
615618 public static final ItemStack BRICK_MOLD = ItemStackBuilder .pylonItem (Material .CLAY_BALL , BaseKeys .BRICK_MOLD )
616- .useCooldown ().set (DataComponentTypes .ITEM_MODEL , Material .OAK_FENCE_GATE .getKey ())
619+ .useCooldown (Settings .get (BaseKeys .BRICK_MOLD ).getOrThrow ("cooldown-ticks" , ConfigAdapter .INT ), BaseKeys .BRICK_MOLD )
620+ .set (DataComponentTypes .ITEM_MODEL , Material .OAK_FENCE_GATE .getKey ())
617621 .build ();
618622 static {
619623 PylonItem .register (BrickMold .class , BRICK_MOLD );
@@ -726,7 +730,7 @@ private BaseItems() {
726730 }
727731
728732 public static final ItemStack BEHEADING_SWORD = ItemStackBuilder .pylonItem (Material .DIAMOND_SWORD , BaseKeys .BEHEADING_SWORD )
729- .durability () // todo: weapon stats?
733+ .durability (Settings . get ( BaseKeys . BEHEADING_SWORD ). getOrThrow ( "durability" , ConfigAdapter . INT )) // todo: weapon stats?
730734 .set (DataComponentTypes .ENCHANTMENT_GLINT_OVERRIDE , true )
731735 .build ();
732736 static {
@@ -1197,7 +1201,7 @@ private BaseItems() {
11971201 }
11981202
11991203 public static final ItemStack RESEARCH_PACK_1 = ItemStackBuilder .pylonItem (Material .RED_BANNER , BaseKeys .RESEARCH_PACK_1 )
1200- .useCooldown ()
1204+ .useCooldown (Settings . get ( BaseKeys . RESEARCH_PACK_1 ). getOrThrow ( "cooldown-ticks" , ConfigAdapter . INT ), BaseKeys . RESEARCH_PACK_1 )
12011205 .set (DataComponentTypes .MAX_STACK_SIZE , 3 )
12021206 .build ();
12031207 static {
@@ -1206,7 +1210,7 @@ private BaseItems() {
12061210 }
12071211
12081212 public static final ItemStack RESEARCH_PACK_2 = ItemStackBuilder .pylonItem (Material .LIME_BANNER , BaseKeys .RESEARCH_PACK_2 )
1209- .useCooldown ()
1213+ .useCooldown (Settings . get ( BaseKeys . RESEARCH_PACK_2 ). getOrThrow ( "cooldown-ticks" , ConfigAdapter . INT ), BaseKeys . RESEARCH_PACK_2 )
12101214 .set (DataComponentTypes .MAX_STACK_SIZE , 3 )
12111215 .build ();
12121216 static {
@@ -1591,15 +1595,17 @@ private BaseItems() {
15911595 ));
15921596 }
15931597 public static final ItemStack REACTIVATED_WITHER_SKULL = ItemStackBuilder .pylonItem (Material .WITHER_SKELETON_SKULL , BaseKeys .REACTIVATED_WITHER_SKULL )
1594- .durability ().useCooldown ()
1598+ .durability (Settings .get (BaseKeys .REACTIVATED_WITHER_SKULL ).getOrThrow ("durability" , ConfigAdapter .INT ))
1599+ .useCooldown (Settings .get (BaseKeys .REACTIVATED_WITHER_SKULL ).getOrThrow ("cooldown-ticks" , ConfigAdapter .INT ), BaseKeys .REACTIVATED_WITHER_SKULL )
15951600 .build ();
15961601 static {
15971602 PylonItem .register (ReactivatedWitherSkull .class , REACTIVATED_WITHER_SKULL );
15981603 BasePages .COMBAT .addItem (REACTIVATED_WITHER_SKULL );
15991604 }
16001605
16011606 public static final ItemStack HYPER_ACTIVATED_WITHER_SKULL = ItemStackBuilder .pylonItem (Material .WITHER_SKELETON_SKULL , BaseKeys .HYPER_ACTIVATED_WITHER_SKULL )
1602- .durability ().useCooldown ()
1607+ .durability (Settings .get (BaseKeys .HYPER_ACTIVATED_WITHER_SKULL ).getOrThrow ("durability" , ConfigAdapter .INT ))
1608+ .useCooldown (Settings .get (BaseKeys .HYPER_ACTIVATED_WITHER_SKULL ).getOrThrow ("cooldown-ticks" , ConfigAdapter .INT ), BaseKeys .HYPER_ACTIVATED_WITHER_SKULL )
16031609 .set (DataComponentTypes .ENCHANTMENT_GLINT_OVERRIDE , true )
16041610 .build ();
16051611 static {
@@ -1617,7 +1623,7 @@ private BaseItems() {
16171623 PylonItem .register (CleansingPotion .class , CLEANSING_POTION );
16181624 BasePages .TOOLS .addItem (CLEANSING_POTION );
16191625
1620- // This recipe isn't configged because we current have no way to set the healing potion data on it
1626+ // This recipe isn't configured because we currently have no way to set the healing potion data on it
16211627 ItemStack healingPotion = ItemStackBuilder .of (Material .SPLASH_POTION )
16221628 .set (DataComponentTypes .POTION_CONTENTS , PotionContents .potionContents ()
16231629 .potion (PotionType .HEALING )
@@ -1666,7 +1672,7 @@ private BaseItems() {
16661672 }
16671673
16681674 public static final ItemStack HYDRAULIC_CANNON = ItemStackBuilder .pylonItem (Material .IRON_HORSE_ARMOR , BaseKeys .HYDRAULIC_CANNON )
1669- .useCooldown ()
1675+ .useCooldown (Settings . get ( BaseKeys . HYDRAULIC_CANNON ). getOrThrow ( "cooldown-ticks" , ConfigAdapter . INT ), BaseKeys . HYDRAULIC_CANNON )
16701676 .editPdc (pdc -> {
16711677 pdc .set (BaseFluids .HYDRAULIC_FLUID .getKey (), PylonSerializers .DOUBLE , 0.0 );
16721678 pdc .set (BaseFluids .DIRTY_HYDRAULIC_FLUID .getKey (), PylonSerializers .DOUBLE , 0.0 );
0 commit comments