@@ -29,13 +29,6 @@ public override void SetDefaults()
29
29
item . useAnimation = 20 ;
30
30
item . rare = 1 ;
31
31
}
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
- }
39
32
public override bool UseItem ( Player player )
40
33
{
41
34
if ( player . altFunctionUse == 2 && ! SecondPoint && TopLeft != null )
@@ -88,19 +81,46 @@ public void SaveStructure(Rectangle target, string targetPath = null)
88
81
Tile tile = Framing . GetTileSafely ( x , y ) ;
89
82
string tileName ;
90
83
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 ;
92
86
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 ;
94
88
else wallName = tile . wall . ToString ( ) ;
95
89
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
+
96
114
byte [ ] wireArray = new byte [ ]
97
115
{
98
116
( byte ) tile . wire ( ) . ToInt ( ) ,
99
117
( byte ) tile . wire2 ( ) . ToInt ( ) ,
100
118
( byte ) tile . wire3 ( ) . ToInt ( ) ,
101
119
( byte ) tile . wire4 ( ) . ToInt ( )
102
120
} ;
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 ) ) ;
104
124
}
105
125
}
106
126
tag . Add ( "TileData" , data ) ;
0 commit comments