11package chronosacaria .mcdw ;
22
3+ import chronosacaria .mcdw .configs .McdwConfig ;
4+ import chronosacaria .mcdw .enchants .EnchantsRegistry ;
5+ import chronosacaria .mcdw .items .ItemRegistry ;
6+ import chronosacaria .mcdw .loottables .McdwLoottables ;
7+ import chronosacaria .mcdw .sounds .McdwSoundEvents ;
8+ import me .sargunvohra .mcmods .autoconfig1u .AutoConfig ;
9+ import me .sargunvohra .mcmods .autoconfig1u .serializer .JanksonConfigSerializer ;
310import net .fabricmc .api .ModInitializer ;
411import net .fabricmc .fabric .api .client .itemgroup .FabricItemGroupBuilder ;
512
13+ import net .minecraft .enchantment .EnchantmentLevelEntry ;
14+ import net .minecraft .item .EnchantedBookItem ;
615import net .minecraft .item .ItemGroup ;
716import net .minecraft .item .ItemStack ;
17+ import net .minecraft .item .Items ;
818import net .minecraft .util .Identifier ;
919
1020import chronosacaria .mcdw .weapons .*;
11- //import chronosacaria.mcdw.entity.McdwEntities;
12-
13-
21+ import net .minecraft .util .registry .Registry ;
1422
1523public class Mcdw implements ModInitializer {
1624
@@ -22,9 +30,83 @@ public class Mcdw implements ModInitializer {
2230 public static final ItemGroup RANGED = FabricItemGroupBuilder .build (
2331 new Identifier (MOD_ID , "weapons/bows" ),
2432 () -> new ItemStack (Bows .BOW_LONGBOW ));
33+ public static final ItemGroup ENCHANTMENTS = FabricItemGroupBuilder .create (
34+ new Identifier (MOD_ID , "enchants" ))
35+ .icon (() -> new ItemStack (Items .ENCHANTED_BOOK ))
36+ .appendItems (itemStacks -> {
37+ //itemStacks.add(EnchantedBookItem.forEnchantment(new EnchantmentLevelEntry(RangedEnchantsRegistry
38+ // .ACCELERATE,1)));
39+ //itemStacks.add(EnchantedBookItem.forEnchantment(new EnchantmentLevelEntry(RangedEnchantsRegistry
40+ // .ACCELERATE,2)));
41+ //itemStacks.add(EnchantedBookItem.forEnchantment(new EnchantmentLevelEntry(RangedEnchantsRegistry
42+ // .ACCELERATE,3)));
43+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ANIMA_CONDUIT ,1 )));
44+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ANIMA_CONDUIT ,2 )));
45+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ANIMA_CONDUIT ,3 )));
46+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CHAINS ,1 )));
47+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CHAINS ,2 )));
48+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CHAINS ,3 )));
49+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .COMMITTED ,1 )));
50+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .COMMITTED ,2 )));
51+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .COMMITTED ,3 )));
52+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CRITICAL_HIT ,1 )));
53+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CRITICAL_HIT ,2 )));
54+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .CRITICAL_HIT ,3 )));
55+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ECHO ,1 )));
56+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ECHO ,2 )));
57+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .ECHO ,3 )));
58+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .EXPLODING ,1 )));
59+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .EXPLODING ,2 )));
60+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .EXPLODING ,3 )));
61+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .FREEZING ,1 )));
62+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .FREEZING ,2 )));
63+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .FREEZING ,3 )));
64+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .GRAVITY ,1 )));
65+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .GRAVITY ,2 )));
66+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .GRAVITY ,3 )));
67+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .JUNGLE_POISON ,1 )));
68+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .JUNGLE_POISON ,2 )));
69+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .JUNGLE_POISON ,3 )));
70+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .LEECHING ,1 )));
71+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .LEECHING ,2 )));
72+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .LEECHING ,3 )));
73+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .POISON_CLOUD ,1 )));
74+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .POISON_CLOUD ,2 )));
75+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .POISON_CLOUD ,3 )));
76+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RADIANCE ,1 )));
77+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RADIANCE ,2 )));
78+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RADIANCE ,3 )));
79+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RAMPAGING ,1 )));
80+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RAMPAGING ,2 )));
81+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RAMPAGING ,3 )));
82+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RICOCHET ,1 )));
83+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RICOCHET ,2 )));
84+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .RICOCHET ,3 )));
85+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SHOCKWAVE ,1 )));
86+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SHOCKWAVE ,2 )));
87+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SHOCKWAVE ,3 )));
88+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SOUL_SIPHON ,1 )));
89+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SOUL_SIPHON ,2 )));
90+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SOUL_SIPHON ,3 )));
91+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .STUNNING ,1 )));
92+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .STUNNING ,2 )));
93+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .STUNNING ,3 )));
94+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SWIRLING ,1 )));
95+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SWIRLING ,2 )));
96+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .SWIRLING ,3 )));
97+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .THUNDERING ,1 )));
98+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .THUNDERING ,2 )));
99+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .THUNDERING ,3 )));
100+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .WEAKENING ,1 )));
101+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .WEAKENING ,2 )));
102+ itemStacks .add (EnchantedBookItem .forEnchantment (new EnchantmentLevelEntry (EnchantsRegistry .WEAKENING ,3 )));
103+ })
104+ .build ();
25105
26106 @ Override
27107 public void onInitialize () {
108+ // Config
109+ AutoConfig .register (McdwConfig .class , JanksonConfigSerializer ::new );
28110
29111 // Melee Weapons
30112 Claymores .init ();
@@ -49,11 +131,21 @@ public void onInitialize() {
49131
50132 // Ranged
51133 Bows .init ();
134+
135+ // Enchants
136+ EnchantsRegistry .init ();
137+
138+ // Items
139+ ItemRegistry .init ();
140+
141+ // Loot
142+ McdwLoottables .init ();
143+
144+ // Sounds
145+ Registry .register (Registry .SOUND_EVENT , McdwSoundEvents .ECHO_SOUND , McdwSoundEvents .ECHO_SOUND_EVENT );
146+
52147 }
53148
54- /*public static void register(){
55- McdwEntities.register();
56- }*/
57149
58150 /*public static void registerServerboundPackets(){
59151 ServerSidePacketRegistry.INSTANCE.register(C2SRotateHeldItem.ID, C2SRotateHeldItem::onPacket);
0 commit comments