| PlacementHook (Func< int, int, int, int, int, int, int > hook, int badReturn, int badResponse, bool processedCoordinates) |
| Used by ObjectData.TileObjectData to provide custom logic to tile placement. hook : The method to call. The return value will be compared against badReturn if relevant. The parameters are: X tile coordinate, Y tile coordinate, tile type, tile style, direction, and alternate index. Use these parameters to execute extra logic for this tile placement. ModLoader.ModTileEntity has a few existing methods to use for various placement hooks. badReturn : Declares what return value from the hook should be interpreted as a failure. Typically -1. badResponse : Set to 0. processedCoordinates : If true, the top left corner coordinates of the tile will be passed into hook rather than the placement coordinate (the placement coordinate is where the mouse would be (Player.tileTargetX and Player.tileTargetY), accounting for the ObjectData.TileObjectData.Origin offset). Typically a true value will make all the logic in the hook method much simpler.
|