@@ -206,11 +206,25 @@ public override void HandleMcpeInventoryContent(McpeInventoryContent message)
206206 public override void HandleMcpeCreativeContent ( McpeCreativeContent message )
207207 {
208208 Log . Warn ( $ "[McpeCreativeContent] Received { message . input . Count } creative items") ;
209+ FileStream file = File . OpenWrite ( "newResources/creativeInventory.txt" ) ;
210+ var writer = new IndentedTextWriter ( new StreamWriter ( file ) , "\t " ) ;
211+ writer . WriteLine ( $ "//Minecraft Bedrock Edition { McpeProtocolInfo . GameVersion } Creative Inventory") ;
209212 foreach ( var item in message . input )
210213 {
211214 //Log.Warn($"Got item: {item.Name} ({item.Id} : {item.Metadata})");
215+ if ( item . ExtraData == null )
216+ {
217+ writer . WriteLine ( $ "new Item({ item . Id } , { item . Metadata } ),") ;
218+ }
219+ else
220+ {
221+ writer . WriteLine ( $ "new Item({ item . Id } , { item . Metadata } ){{ ExtraData = { item . ExtraData } }},") ;
222+ }
212223 }
213224 Log . Warn ( $ "[McpeCreativeContent] Done reading { message . input . Count } creative items\n ") ;
225+ writer . Flush ( ) ;
226+ file . Close ( ) ;
227+ Log . Warn ( "Received creative items exported to newResources/creativeInventory.txt\n " ) ;
214228 }
215229
216230 public override void HandleMcpeAddItemEntity ( McpeAddItemEntity message )
@@ -458,7 +472,7 @@ public override void HandleMcpeCraftingData(McpeCraftingData message)
458472 {
459473 if ( Client . IsEmulator ) return ;
460474
461- string fileName = Path . GetTempPath ( ) + "Recipes_" + Guid . NewGuid ( ) + " .txt";
475+ string fileName = "newResources/recipes .txt";
462476 Log . Info ( "Writing recipes to filename: " + fileName ) ;
463477 FileStream file = File . OpenWrite ( fileName ) ;
464478
@@ -569,6 +583,7 @@ public override void HandleMcpeCraftingData(McpeCraftingData message)
569583
570584 writer . Flush ( ) ;
571585 file . Close ( ) ;
586+ Log . Warn ( "Received recipes exported to newResources/recipes.txt\n " ) ;
572587 //Environment.Exit(0);
573588 }
574589
@@ -723,7 +738,8 @@ public override void HandleMcpeBiomeDefinitionList(McpeBiomeDefinitionList messa
723738
724739 var root = message . namedtag . NbtFile . RootTag ;
725740 //Log.Debug($"\n{root}");
726- File . WriteAllText ( Path . Combine ( Path . GetTempPath ( ) , "Biomes_" + Guid . NewGuid ( ) + ".txt" ) , root . ToString ( ) ) ;
741+ File . WriteAllText ( "newResources/biomes.txt" , root . ToString ( ) ) ;
742+ Log . Warn ( "Received biome definitions exported to newResources/biomes.txt\n " ) ;
727743 }
728744
729745 public override void HandleMcpeNetworkChunkPublisherUpdate ( McpeNetworkChunkPublisherUpdate message )
0 commit comments