@@ -29,13 +29,6 @@ public override void SetDefaults()
2929 item . useAnimation = 20 ;
3030 item . rare = 1 ;
3131 }
32- public override void AddRecipes ( )
33- {
34- ModRecipe r = new ModRecipe ( mod ) ;
35- r . AddIngredient ( ItemID . DirtBlock , 1 ) ;
36- r . SetResult ( this ) ;
37- r . AddRecipe ( ) ;
38- }
3932 public override bool UseItem ( Player player )
4033 {
4134 if ( player . altFunctionUse == 2 && ! SecondPoint && TopLeft != null )
@@ -88,19 +81,46 @@ public void SaveStructure(Rectangle target, string targetPath = null)
8881 Tile tile = Framing . GetTileSafely ( x , y ) ;
8982 string tileName ;
9083 string wallName ;
91- if ( tile . type > Main . maxTileSets ) tileName = ModContent . GetModTile ( tile . type ) . GetType ( ) . AssemblyQualifiedName ;
84+ string teName ;
85+ if ( tile . type > Main . maxTileSets ) tileName = ModContent . GetModTile ( tile . type ) . mod . Name + " " + ModContent . GetModTile ( tile . type ) . Name ;
9286 else tileName = tile . type . ToString ( ) ;
93- if ( tile . wall > Main . maxWallTypes ) wallName = ModContent . GetModWall ( tile . wall ) . GetType ( ) . AssemblyQualifiedName ;
87+ if ( tile . wall > Main . maxWallTypes ) wallName = ModContent . GetModWall ( tile . wall ) . mod . Name + " " + ModContent . GetModWall ( tile . wall ) . Name ;
9488 else wallName = tile . wall . ToString ( ) ;
9589
90+ TileEntity teTarget = null ; //grabbing TE data
91+ TagCompound entityTag = null ;
92+
93+ if ( TileEntity . ByPosition . ContainsKey ( new Point16 ( x , y ) ) ) teTarget = TileEntity . ByPosition [ new Point16 ( x , y ) ] ;
94+
95+ if ( teTarget != null )
96+ {
97+ if ( teTarget . type < 2 )
98+ {
99+ teName = teTarget . type . ToString ( ) ;
100+ }
101+ else
102+ {
103+ ModTileEntity entityTarget = ModTileEntity . GetTileEntity ( teTarget . type ) ;
104+ if ( entityTarget != null )
105+ {
106+ teName = entityTarget . mod . Name + " " + entityTarget . Name ;
107+ entityTag = ( teTarget as ModTileEntity ) . Save ( ) ;
108+ }
109+ else teName = "" ;
110+ }
111+ }
112+ else teName = "" ;
113+
96114 byte [ ] wireArray = new byte [ ]
97115 {
98116 ( byte ) tile . wire ( ) . ToInt ( ) ,
99117 ( byte ) tile . wire2 ( ) . ToInt ( ) ,
100118 ( byte ) tile . wire3 ( ) . ToInt ( ) ,
101119 ( byte ) tile . wire4 ( ) . ToInt ( )
102120 } ;
103- data . Add ( new TileSaveData ( tile . active ( ) , tileName , wallName , tile . frameX , tile . frameY , ( short ) tile . wallFrameX ( ) , ( short ) tile . wallFrameY ( ) , tile . slope ( ) , tile . halfBrick ( ) , tile . actuator ( ) , tile . nactive ( ) , tile . liquid , tile . liquidType ( ) , tile . color ( ) , tile . wallColor ( ) , wireArray ) ) ;
121+ data . Add ( new TileSaveData ( tile . active ( ) , tileName , wallName , tile . frameX , tile . frameY , ( short ) tile . wallFrameX ( ) , ( short ) tile . wallFrameY ( ) ,
122+ tile . slope ( ) , tile . halfBrick ( ) , tile . actuator ( ) , ! tile . nactive ( ) , tile . liquid , tile . liquidType ( ) , tile . color ( ) , tile . wallColor ( ) , wireArray ,
123+ teName , entityTag ) ) ;
104124 }
105125 }
106126 tag . Add ( "TileData" , data ) ;
0 commit comments