@@ -210,11 +210,13 @@ private void PopulateIndividualItemStackSize()
210210 }
211211 else
212212 {
213- foreach ( KeyValuePair < string , int > vanillaStack in _vanillaDefaults )
213+ foreach ( ItemDefinition itemDefinition in ItemManager . GetItemDefinitions ( ) )
214214 {
215- if ( ! _config . IndividualItemStackSize . ContainsKey ( vanillaStack . Key ) )
215+ if ( ! _config . IndividualItemStackSize . ContainsKey ( itemDefinition . shortname ) )
216216 {
217- _config . IndividualItemStackSize . Add ( vanillaStack . Key , vanillaStack . Value ) ;
217+ Log ( $ "Adding new item { itemDefinition . shortname } to IndividualItemStackSize in configuration.") ;
218+
219+ _config . IndividualItemStackSize . Add ( itemDefinition . shortname , itemDefinition . stackable ) ;
218220 }
219221 }
220222 }
@@ -403,6 +405,13 @@ private void ListCategoryItemsCommand(IPlayer player, string command, string[] a
403405
404406 private void GenerateVanillaStackSizeFileCommand ( IPlayer player , string command , string [ ] args )
405407 {
408+ GenerateVanillaStackSizeFile ( ) ;
409+ }
410+
411+ private void GenerateVanillaStackSizeFile ( )
412+ {
413+ RevertStackSizes ( ) ;
414+
406415 SortedDictionary < string , int > vanillaStackSizes = new SortedDictionary < string , int > ( ) ;
407416
408417 foreach ( ItemDefinition itemDefinition in ItemManager . GetItemDefinitions ( ) )
@@ -413,7 +422,9 @@ private void GenerateVanillaStackSizeFileCommand(IPlayer player, string command,
413422 Interface . Oxide . DataFileSystem . WriteObject ( nameof ( StackSizeController ) + "_vanilla-defaults" ,
414423 vanillaStackSizes ) ;
415424
416- player . Reply ( "DEV: Vanilla stack sizes file generated from current stack sizes." ) ;
425+ SetStackSizes ( ) ;
426+
427+ Log ( "Vanilla stack sizes file updated." ) ;
417428 }
418429
419430 #endregion
0 commit comments