@@ -1052,6 +1052,7 @@ pub enum InventoryBacking<T> {
1052
1052
boots : [ T ; 1 ] ,
1053
1053
storage : [ T ; 27 ] ,
1054
1054
hotbar : [ T ; 9 ] ,
1055
+ offhand : [ T ; 1 ] ,
1055
1056
} ,
1056
1057
Chest {
1057
1058
storage : [ T ; 27 ] ,
@@ -1078,6 +1079,7 @@ impl<T> InventoryBacking<T> {
1078
1079
boots,
1079
1080
storage,
1080
1081
hotbar,
1082
+ offhand,
1081
1083
} => match area {
1082
1084
Area :: CraftingInput => Some ( crafting_input. as_ref ( ) ) ,
1083
1085
Area :: CraftingOutput => Some ( crafting_output. as_ref ( ) ) ,
@@ -1087,6 +1089,7 @@ impl<T> InventoryBacking<T> {
1087
1089
Area :: Boots => Some ( boots. as_ref ( ) ) ,
1088
1090
Area :: Storage => Some ( storage. as_ref ( ) ) ,
1089
1091
Area :: Hotbar => Some ( hotbar. as_ref ( ) ) ,
1092
+ Area :: Offhand => Some ( offhand. as_ref ( ) ) ,
1090
1093
_ => None ,
1091
1094
} ,
1092
1095
InventoryBacking :: Chest { storage } => match area {
@@ -1116,7 +1119,7 @@ impl<T> InventoryBacking<T> {
1116
1119
pub fn areas ( & self ) -> & ' static [ Area ] {
1117
1120
match self {
1118
1121
InventoryBacking :: Player { .. } => {
1119
- static AREAS : [ Area ; 8 ] = [
1122
+ static AREAS : [ Area ; 9 ] = [
1120
1123
Area :: CraftingInput ,
1121
1124
Area :: CraftingOutput ,
1122
1125
Area :: Helmet ,
@@ -1125,6 +1128,7 @@ impl<T> InventoryBacking<T> {
1125
1128
Area :: Boots ,
1126
1129
Area :: Storage ,
1127
1130
Area :: Hotbar ,
1131
+ Area :: Offhand ,
1128
1132
] ;
1129
1133
& AREAS
1130
1134
}
@@ -1159,6 +1163,7 @@ impl<T> InventoryBacking<T> {
1159
1163
boots : Default :: default ( ) ,
1160
1164
storage : Default :: default ( ) ,
1161
1165
hotbar : Default :: default ( ) ,
1166
+ offhand : Default :: default ( ) ,
1162
1167
}
1163
1168
}
1164
1169
pub fn chest ( ) -> Self
0 commit comments