@@ -3,24 +3,23 @@ use std::{cmp::Ordering, collections::HashMap, sync::LazyLock};
33use azalea:: {
44 app:: { App , Plugin } ,
55 ecs:: prelude:: * ,
6- entity:: { LocalEntity , LookDirection , metadata:: Player } ,
6+ entity:: { inventory :: Inventory , metadata:: Player , LocalEntity , LookDirection } ,
77 inventory:: {
8+ operations:: { ClickOperation , SwapClick } ,
89 ContainerClickEvent ,
9- Inventory ,
1010 InventorySystems ,
11- operations:: { ClickOperation , SwapClick } ,
1211 } ,
1312 local_player:: Hunger ,
1413 mining:: continue_mining_block,
15- packet:: game:: { SendGamePacketEvent , handle_outgoing_packets_observer } ,
14+ packet:: game:: { handle_outgoing_packets_observer , SendGamePacketEvent } ,
1615 physics:: PhysicsSystems ,
1716 prelude:: * ,
1817 protocol:: packets:: game:: {
18+ s_interact:: InteractionHand ,
1919 ServerboundGamePacket ,
2020 ServerboundUseItem ,
21- s_interact:: InteractionHand ,
2221 } ,
23- registry:: Item ,
22+ registry:: builtin :: ItemKind ,
2423} ;
2524
2625use crate :: prelude:: * ;
@@ -119,41 +118,41 @@ impl AutoEatPlugin {
119118 }
120119}
121120
122- pub static FOOD_ITEMS : LazyLock < HashMap < Item , ( i32 , f32 ) > > = LazyLock :: new ( || {
121+ pub static FOOD_ITEMS : LazyLock < HashMap < ItemKind , ( i32 , f32 ) > > = LazyLock :: new ( || {
123122 HashMap :: from ( [
124- ( Item :: Apple , ( 4 , 2.4 ) ) ,
125- ( Item :: BakedPotato , ( 5 , 6.0 ) ) ,
126- ( Item :: Beef , ( 3 , 1.8 ) ) ,
127- ( Item :: Beetroot , ( 1 , 1.2 ) ) ,
128- ( Item :: BeetrootSoup , ( 6 , 7.2 ) ) ,
129- ( Item :: Bread , ( 5 , 6.0 ) ) ,
130- ( Item :: Carrot , ( 3 , 3.6 ) ) ,
131- ( Item :: Chicken , ( 2 , 1.2 ) ) ,
132- ( Item :: Cod , ( 2 , 0.4 ) ) ,
133- ( Item :: CookedBeef , ( 8 , 12.8 ) ) ,
134- ( Item :: CookedChicken , ( 6 , 7.2 ) ) ,
135- ( Item :: CookedCod , ( 5 , 6.0 ) ) ,
136- ( Item :: CookedMutton , ( 6 , 9.6 ) ) ,
137- ( Item :: CookedPorkchop , ( 8 , 12.8 ) ) ,
138- ( Item :: CookedRabbit , ( 5 , 6.0 ) ) ,
139- ( Item :: CookedSalmon , ( 6 , 9.6 ) ) ,
140- ( Item :: Cookie , ( 2 , 0.4 ) ) ,
141- ( Item :: DriedKelp , ( 1 , 0.6 ) ) ,
142- ( Item :: EnchantedGoldenApple , ( 4 , 9.6 ) ) ,
143- ( Item :: GlowBerries , ( 2 , 0.4 ) ) ,
144- ( Item :: GoldenApple , ( 4 , 9.6 ) ) ,
145- ( Item :: GoldenCarrot , ( 6 , 14.4 ) ) ,
146- ( Item :: HoneyBottle , ( 6 , 1.2 ) ) ,
147- ( Item :: MelonSlice , ( 2 , 1.2 ) ) ,
148- ( Item :: MushroomStew , ( 6 , 7.2 ) ) ,
149- ( Item :: Mutton , ( 2 , 1.2 ) ) ,
150- ( Item :: Porkchop , ( 3 , 1.8 ) ) ,
151- ( Item :: Potato , ( 1 , 0.6 ) ) ,
152- ( Item :: PumpkinPie , ( 8 , 4.8 ) ) ,
153- ( Item :: Rabbit , ( 3 , 1.8 ) ) ,
154- ( Item :: RabbitStew , ( 10 , 12.0 ) ) ,
155- ( Item :: Salmon , ( 2 , 0.4 ) ) ,
156- ( Item :: SweetBerries , ( 2 , 0.4 ) ) ,
157- ( Item :: TropicalFish , ( 1 , 0.2 ) ) ,
123+ ( ItemKind :: Apple , ( 4 , 2.4 ) ) ,
124+ ( ItemKind :: BakedPotato , ( 5 , 6.0 ) ) ,
125+ ( ItemKind :: Beef , ( 3 , 1.8 ) ) ,
126+ ( ItemKind :: Beetroot , ( 1 , 1.2 ) ) ,
127+ ( ItemKind :: BeetrootSoup , ( 6 , 7.2 ) ) ,
128+ ( ItemKind :: Bread , ( 5 , 6.0 ) ) ,
129+ ( ItemKind :: Carrot , ( 3 , 3.6 ) ) ,
130+ ( ItemKind :: Chicken , ( 2 , 1.2 ) ) ,
131+ ( ItemKind :: Cod , ( 2 , 0.4 ) ) ,
132+ ( ItemKind :: CookedBeef , ( 8 , 12.8 ) ) ,
133+ ( ItemKind :: CookedChicken , ( 6 , 7.2 ) ) ,
134+ ( ItemKind :: CookedCod , ( 5 , 6.0 ) ) ,
135+ ( ItemKind :: CookedMutton , ( 6 , 9.6 ) ) ,
136+ ( ItemKind :: CookedPorkchop , ( 8 , 12.8 ) ) ,
137+ ( ItemKind :: CookedRabbit , ( 5 , 6.0 ) ) ,
138+ ( ItemKind :: CookedSalmon , ( 6 , 9.6 ) ) ,
139+ ( ItemKind :: Cookie , ( 2 , 0.4 ) ) ,
140+ ( ItemKind :: DriedKelp , ( 1 , 0.6 ) ) ,
141+ ( ItemKind :: EnchantedGoldenApple , ( 4 , 9.6 ) ) ,
142+ ( ItemKind :: GlowBerries , ( 2 , 0.4 ) ) ,
143+ ( ItemKind :: GoldenApple , ( 4 , 9.6 ) ) ,
144+ ( ItemKind :: GoldenCarrot , ( 6 , 14.4 ) ) ,
145+ ( ItemKind :: HoneyBottle , ( 6 , 1.2 ) ) ,
146+ ( ItemKind :: MelonSlice , ( 2 , 1.2 ) ) ,
147+ ( ItemKind :: MushroomStew , ( 6 , 7.2 ) ) ,
148+ ( ItemKind :: Mutton , ( 2 , 1.2 ) ) ,
149+ ( ItemKind :: Porkchop , ( 3 , 1.8 ) ) ,
150+ ( ItemKind :: Potato , ( 1 , 0.6 ) ) ,
151+ ( ItemKind :: PumpkinPie , ( 8 , 4.8 ) ) ,
152+ ( ItemKind :: Rabbit , ( 3 , 1.8 ) ) ,
153+ ( ItemKind :: RabbitStew , ( 10 , 12.0 ) ) ,
154+ ( ItemKind :: Salmon , ( 2 , 0.4 ) ) ,
155+ ( ItemKind :: SweetBerries , ( 2 , 0.4 ) ) ,
156+ ( ItemKind :: TropicalFish , ( 1 , 0.2 ) ) ,
158157 ] )
159158} ) ;
0 commit comments