This class allows you to modify the behavior of any tile in the game, both vanilla and modded.
To use it, simply create a new class deriving from this one. Implementations will be registered automatically.
More...
|
void | AddToArray (ref int[] array, int type) |
| A convenient method for adding an integer to the end of an array. This can be used with the arrays in TileID.Sets.RoomNeeds. More...
|
|
virtual int[] | AdjTiles (int type) |
| Allows you to determine which tiles the given tile type can be considered as when looking for crafting stations. More...
|
|
virtual void | AnimateTile () |
| Allows animating tiles that were previously static. Loading a new texture for the tile is required first. Use Main.tileFrameCounter to count game frames and Main.tileFrame to change animation frames.
|
|
virtual bool | AutoSelect (int i, int j, int type, Item item) |
| Allows you to determine whether the given item can become selected when the cursor is hovering over a tile and the auto selection keybind is pressed. More...
|
|
virtual bool | CanDrop (int i, int j, int type) |
| Allows prevention of item drops from the tile dropping at the given coordinates. Return false to stop the game from dropping the tile's item(s). Returns true by default. Use Drop to spawn additional items.
|
|
virtual bool | CanKillTile (int i, int j, int type, ref bool blockDamaged) |
| Allows you to determine whether or not the tile at the given coordinates can be hit by anything. Returns true by default. blockDamaged currently has no use. More...
|
|
virtual bool | CanReplace (int i, int j, int type, int tileTypeBeingPlaced) |
| Allows you to stop a tile at the given coordinates from being replaced via the block swap feature. The tileTypeBeingPlaced parameter is the tile type that will replace the current tile. The type parameter is the tile type currently at the coordinates.
This method is called on the local client. This method is only called if the local player has sufficient pickaxe power to mine the existing tile.
Return false to block the tile from being replaced. Returns true by default.
Use this for dynamic logic. ID.TileID.Sets.DoesntGetReplacedWithTileReplacement, ID.TileID.Sets.DoesntPlaceWithTileReplacement, and ID.TileID.Sets.PreventsTileReplaceIfOnTopOfIt cover the most common use cases and should be used instead if possible. More...
|
|
virtual void | ChangeWaterfallStyle (int type, ref int style) |
| Allows you to change the style of waterfall that passes through or over any tile. More...
|
|
virtual void | DrawEffects (int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData) |
| Allows you to make stuff happen whenever the tile at the given coordinates is drawn. For example, creating dust or changing the color the tile is drawn in. SpecialDraw will only be called if coordinates are added using Main.instance.TilesRenderer.AddSpecialLegacyPoint here. More...
|
|
virtual void | Drop (int i, int j, int type) |
| Allows you to spawn additional items when the tile at the given coordinates drops.
This hook is called once for multi-tiles. Trees or Cactus call this method for every individual tile.
For multi-tiles, the coordinates correspond to the tile that triggered this multi-tile to drop, so if checking Tile.TileFrameX and Tile.TileFrameY, be aware that the coordinates won't necessarily be the top left corner or origin of the multi-tile. Also be aware that some parts of the multi-tile might already be mined out when this method is called, so any math to determine tile style should be done on the tile at the coordinates passed in.
|
|
virtual void | DropCritterChance (int i, int j, int type, ref int wormChance, ref int grassHopperChance, ref int jungleGrubChance) |
| Allows you to modify the chance the tile at the given coordinates has of spawning a certain critter when the tile is killed. More...
|
|
virtual void | FloorVisuals (int type, Player player) |
| Allows you to make something happen when a player stands on the given type of tile. For example, you can make the player slide as if on ice. More...
|
|
virtual void | HitWire (int i, int j, int type) |
| Allows you to make something happen when a wire current passes through any tile. Both Wiring.SkipWire(int, int) and NetMessage.SendTileSquare(int, int, int, int, ID.TileChangeType) are usually required in the logic used in this method to correctly work.
Only called on the server and single player. All wiring happens on the world, not multiplayer clients. More...
|
|
virtual ? bool | IsTileBiomeSightable (int i, int j, int type, ref Color sightColor) |
| Allows you to customize whether this tile glows sightColor while the local player has the Biome Sight buff.
Return true to force this behavior, or false to prevent it, overriding vanilla conditions and colors. Returns null by default.
This is only called on the local client. More...
|
|
virtual ? bool | IsTileDangerous (int i, int j, int type, Player player) |
| Allows you to determine whether this tile glows red when the given player has the Dangersense buff.
Return true to force this behavior, or false to prevent it, overriding vanilla conditions. Returns null by default.
This is only called on the local client. More...
|
|
virtual ? bool | IsTileSpelunkable (int i, int j, int type) |
| Allows you to customize whether this tile can glow yellow while having the Spelunker buff, and is also detected by various pets.
Return true to force this behavior, or false to prevent it, overriding vanilla conditions. Returns null by default. More...
|
|
virtual void | KillTile (int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) |
| Allows you to determine what happens when the tile at the given coordinates is killed or hit with a pickaxe. If fail is true, the tile will not be mined; effectOnly makes it so that only dust is created; noItem stops items from dropping. More...
|
|
virtual void | MouseOver (int i, int j, int type) |
| Allows you to make something happen when the mouse hovers over any tile. Useful for showing item icons or text on the mouse. More...
|
|
virtual void | MouseOverFar (int i, int j, int type) |
| Allows you to make something happen when the mouse hovers over any tile, even when the player is far away. Useful for showing what's written on signs, etc. More...
|
|
virtual void | NearbyEffects (int i, int j, int type, bool closer) |
|
virtual void | PostSetupTileMerge () |
| Can be used to adjust tile merge related things that are not possible to do in ModBlockType.SetStaticDefaults due to timing.
|
|
virtual bool | PreHitWire (int i, int j, int type) |
| Whether or not the vanilla HitWire code and the HitWire hook is allowed to run. Useful for overriding vanilla behavior by returning false. Returns true by default. More...
|
|
virtual void | RightClick (int i, int j, int type) |
| Allows you to make something happen when any tile is right-clicked by the player. More...
|
|
virtual void | SetSpriteEffects (int i, int j, int type, ref SpriteEffects spriteEffects) |
| Allows you to determine whether or not a tile will draw itself flipped in the world. More...
|
|
sealed override void | SetupContent () |
| If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
|
|
virtual bool | Slope (int i, int j, int type) |
| Allows you to control how hammers slope any tile. Return true to allow the tile to slope normally. Returns true by default. Called on the local Client and Single Player. More...
|
|
virtual void | SpecialDraw (int i, int j, int type, SpriteBatch spriteBatch) |
| Special Draw. Only called if coordinates are added using Main.instance.TilesRenderer.AddSpecialLegacyPoint during DrawEffects. Useful for drawing things that would otherwise be impossible to draw due to draw order, such as items in item frames. More...
|
|
virtual bool | TileFrame (int i, int j, int type, ref bool resetFrame, ref bool noBreak) |
| Called for every tile that updates due to being placed or being next to a tile that is changed. Return false to stop the game from carrying out its default TileFrame operations. Returns true by default. More...
|
|
virtual bool | CanExplode (int i, int j, int type) |
| Whether or not the tile/wall at the given coordinates can be killed by an explosion (ie. bombs). Returns true by default; return false to stop an explosion from destroying it. More...
|
|
virtual bool | CanPlace (int i, int j, int type) |
| Allows you to stop a tile/wall from being placed at the given coordinates. Return false to block the tile/wall from being placed. Returns true by default. More...
|
|
virtual bool | CreateDust (int i, int j, int type, ref int dustType) |
| Allows you to modify the default type of dust created when the tile/wall at the given coordinates is hit. Return false to stop the default dust (the dustType parameter) from being created. Returns true by default. More...
|
|
virtual bool | KillSound (int i, int j, int type, bool fail) |
| Allows you to customize which sound you want to play when the tile/wall at the given coordinates is hit. Return false to stop the game from playing its default sound for the tile/wall. Returns true by default. More...
|
|
virtual void | ModifyLight (int i, int j, int type, ref float r, ref float g, ref float b) |
| Allows you to determine how much light the block emits. If it is a tile, make sure you set Main.tileLighted[Type] to true in SetDefaults for this to work. If it is a wall, it can also let you light up the block in front of this wall. More...
|
|
virtual void | NumDust (int i, int j, int type, bool fail, ref int num) |
| Allows you to change how many dust particles are created when the tile/wall at the given coordinates is hit. More...
|
|
virtual void | PlaceInWorld (int i, int j, int type, Item item) |
| Allows you to do something when this tile/wall is placed. Called on the local Client and Single Player. More...
|
|
virtual void | PostDraw (int i, int j, int type, SpriteBatch spriteBatch) |
| Allows you to draw things in front of the tile/wall at the given coordinates. This can also be used to do things such as creating dust. Called on active tiles. See also ModSystem.PostDrawTiles. More...
|
|
virtual bool | PreDraw (int i, int j, int type, SpriteBatch spriteBatch) |
| Allows you to draw things behind the tile/wall at the given coordinates. Return false to stop the game from drawing the tile/wall normally. Returns true by default. More...
|
|
virtual void | RandomUpdate (int i, int j, int type) |
| Called for every tile/wall the world randomly decides to update in a given tick. Useful for things such as growing or spreading. More...
|
|
virtual TModType | Clone (TEntity newEntity) |
| Create a copy of this instanced global. Called when an entity is cloned. More...
|
|
virtual bool | IsLoadingEnabled (Mod mod) |
| Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
|
|
virtual void | Load () |
| Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
|
|
virtual TModType | NewInstance (TEntity entity) |
| Create a new instance of this ModType for a specific entity More...
|
|
string | PrettyPrintName () |
|
virtual void | SetStaticDefaults () |
| Allows you to modify the properties after initial loading has completed. More...
|
|
virtual void | SetupContent () |
| If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
|
|
virtual void | Unload () |
| Allows you to safely unload things you added in Load. More...
|
|
virtual bool | IsLoadingEnabled (Mod mod) |
| Whether or not this type should be loaded when it's told to. Returning false disables Mod.AddContent from actually loading this type. More...
|
|
abstract void | Load (Mod mod) |
| Called when loading the type. More...
|
|
abstract void | Unload () |
| Called during unloading when needed. More...
|
|
virtual TModType | Clone (TEntity newEntity) |
| Create a copy of this instanced global. Called when an entity is cloned. More...
|
|
virtual bool | IsLoadingEnabled (Mod mod) |
| Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
|
|
virtual void | Load () |
| Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
|
|
virtual TModType | NewInstance (TEntity entity) |
| Create a new instance of this ModType for a specific entity More...
|
|
string | PrettyPrintName () |
|
virtual void | SetStaticDefaults () |
| Allows you to modify the properties after initial loading has completed. More...
|
|
virtual void | SetupContent () |
| If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
|
|
virtual void | Unload () |
| Allows you to safely unload things you added in Load. More...
|
|