tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
This class allows you to modify the behavior of any tile in the game. Create an instance of an overriding class then call Mod.AddGlobalTile to use this. More...
Public Member Functions | |
void | AddModCactus (int soilType, ModCactus cactus) |
Allows the given type of tile to grow the given modded cactus. More... | |
void | AddModPalmTree (int soilType, ModPalmTree palmTree) |
Allows the given type of tile to grow the given modded palm tree. More... | |
void | AddModTree (int soilType, ModTree tree) |
Allows the given type of tile to grow the given modded tree. 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. More... | |
virtual bool | Autoload (ref string name) |
Allows you to automatically load a GlobalTile instead of using Mod.AddGlobalTile. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name. More... | |
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 hotkey is pressed. More... | |
virtual bool | CanExplode (int i, int j, int type) |
Whether or not the tile 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 | 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 | CanPlace (int i, int j, int type) |
Allows you to stop a tile from being placed at the given coordinates. Return false to block the tile from being placed. Returns true by default. 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 bool | CreateDust (int i, int j, int type, ref int dustType) |
Allows you to modify the default type of dust created when the tile 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 | Dangersense (int i, int j, int type, Player player) |
Allows you to determine whether the block glows red when the given player has the Dangersense buff. More... | |
virtual void | DrawEffects (int i, int j, int type, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) |
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. More... | |
virtual bool | Drop (int i, int j, int type) |
Allows you to customize which items the tile at the given coordinates drops. Return false to stop the game from dropping the tile's default item. Returns true by default. More... | |
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. More... | |
virtual bool | KillSound (int i, int j, int type) |
Allows you to customize which sound you want to play when the tile at the given coordinates is hit. Return false to stop the game from playing its default sound for the tile. Returns true 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 | 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. Make sure you set Main.tileLighted[type] to true in SetDefaults for this to work. 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) |
Allows you to make things happen when the tile is within a certain range of the player (around the same range water fountains and music boxes work). The closer parameter is whether or not the tile is within the range at which things like campfires and banners work. 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 at the given coordinates is hit. More... | |
virtual void | PlaceInWorld (int i, int j, Item item) |
Allows you to do something when this tile 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 at the given coordinates. This can also be used to do things such as creating dust. Called on active tiles. See also ModWorld.PostDrawTiles. More... | |
virtual bool | PreDraw (int i, int j, int type, SpriteBatch spriteBatch) |
Allows you to draw things behind the tile at the given coordinates. Return false to stop the game from drawing the tile normally. Returns true by default. More... | |
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 | RandomUpdate (int i, int j, int type) |
Called for every tile the world randomly decides to update in a given tick. Useful for things such as growing or spreading. 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 int | SaplingGrowthType (int type, ref int style) |
Allows a tile to support a sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns -1 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0. More... | |
virtual void | SetDefaults () |
Allows you to modify the properties of any tile in the game. Most properties are stored as arrays throughout the Terraria code. 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... | |
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 placed in Main.specX/Y 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... | |
Properties | |
Mod | mod [get, set] |
The mod to which this GlobalTile belongs to. More... | |
string | Name [get, set] |
The name of this GlobalTile instance. More... | |
This class allows you to modify the behavior of any tile in the game. Create an instance of an overriding class then call Mod.AddGlobalTile to use this.
Definition at line 10 of file GlobalTile.cs.
void Terraria.ModLoader.GlobalTile.AddModCactus | ( | int | soilType, |
ModCactus | cactus | ||
) |
Allows the given type of tile to grow the given modded cactus.
soilType | |
cactus |
Definition at line 61 of file GlobalTile.cs.
void Terraria.ModLoader.GlobalTile.AddModPalmTree | ( | int | soilType, |
ModPalmTree | palmTree | ||
) |
Allows the given type of tile to grow the given modded palm tree.
soilType | |
palmTree |
Definition at line 52 of file GlobalTile.cs.
void Terraria.ModLoader.GlobalTile.AddModTree | ( | int | soilType, |
ModTree | tree | ||
) |
Allows the given type of tile to grow the given modded tree.
soilType | |
tree |
Definition at line 43 of file GlobalTile.cs.
void Terraria.ModLoader.GlobalTile.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.
array | |
type |
Definition at line 33 of file GlobalTile.cs.
|
virtual |
Allows you to determine which tiles the given tile type can be considered as when looking for crafting stations.
type |
Definition at line 298 of file GlobalTile.cs.
|
virtual |
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.
Definition at line 215 of file GlobalTile.cs.
|
virtual |
Allows you to automatically load a GlobalTile instead of using Mod.AddGlobalTile. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name.
name |
Definition at line 70 of file GlobalTile.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.GlobalTile.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalTile().
|
virtual |
Allows you to determine whether the given item can become selected when the cursor is hovering over a tile and the auto selection hotkey is pressed.
i | |
j | |
type | |
item |
Definition at line 337 of file GlobalTile.cs.
|
virtual |
Whether or not the tile 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.
i | |
j | |
type |
Definition at line 164 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type | |
blockDamaged |
Definition at line 141 of file GlobalTile.cs.
|
virtual |
Allows you to stop a tile from being placed at the given coordinates. Return false to block the tile from being placed. Returns true by default.
i | |
j | |
type |
Definition at line 289 of file GlobalTile.cs.
|
virtual |
Allows you to change the style of waterfall that passes through or over any tile.
type | |
style |
Definition at line 385 of file GlobalTile.cs.
|
virtual |
Allows you to modify the default type of dust created when the tile at the given coordinates is hit. Return false to stop the default dust (the dustType parameter) from being created. Returns true by default.
i | |
j | |
type | |
dustType |
Definition at line 110 of file GlobalTile.cs.
|
virtual |
Allows you to determine whether the block glows red when the given player has the Dangersense buff.
i | |
j | |
type | |
player |
Definition at line 198 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type | |
spriteBatch | |
drawColor | |
nextSpecialDrawIndex | The special draw count. Use with Main.specX and Main.specY and then increment to draw special things after the main tile drawing loop is complete via DrawSpecial. |
Definition at line 239 of file GlobalTile.cs.
|
virtual |
Allows you to customize which items the tile at the given coordinates drops. Return false to stop the game from dropping the tile's default item. Returns true by default.
Definition at line 129 of file GlobalTile.cs.
|
virtual |
Allows you to modify the chance the tile at the given coordinates has of spawning a certain critter when the tile is killed.
i | |
j | |
type | |
wormChance | |
grassHopperChance | |
jungleGrubChance |
Definition at line 123 of file GlobalTile.cs.
|
virtual |
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.
type | |
player |
Definition at line 377 of file GlobalTile.cs.
|
virtual |
Allows you to make something happen when a wire current passes through any tile.
i | |
j | |
type |
Definition at line 358 of file GlobalTile.cs.
|
virtual |
Allows you to customize which sound you want to play when the tile at the given coordinates is hit. Return false to stop the game from playing its default sound for the tile. Returns true by default.
i | |
j | |
type |
Definition at line 87 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type | |
fail | |
effectOnly | |
noItem |
Definition at line 154 of file GlobalTile.cs.
|
virtual |
Allows you to determine how much light the block emits. Make sure you set Main.tileLighted[type] to true in SetDefaults for this to work.
i | |
j | |
type | |
r | |
g | |
b |
Definition at line 187 of file GlobalTile.cs.
|
virtual |
Allows you to make something happen when the mouse hovers over any tile. Useful for showing item icons or text on the mouse.
i | |
j | |
type |
Definition at line 317 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type |
Definition at line 326 of file GlobalTile.cs.
|
virtual |
Allows you to make things happen when the tile is within a certain range of the player (around the same range water fountains and music boxes work). The closer parameter is whether or not the tile is within the range at which things like campfires and banners work.
i | |
j | |
type | |
closer |
Definition at line 175 of file GlobalTile.cs.
|
virtual |
Allows you to change how many dust particles are created when the tile at the given coordinates is hit.
i | |
j | |
type | |
fail | |
num |
Definition at line 99 of file GlobalTile.cs.
|
virtual |
Allows you to do something when this tile is placed. Called on the local Client and Single Player.
i | The x position in tile coordinates. Equal to Player.tileTargetX |
j | The y position in tile coordinates. Equal to Player.tileTargetY |
item | The item used to place this tile. |
Definition at line 404 of file GlobalTile.cs.
|
virtual |
Allows you to draw things in front of the tile at the given coordinates. This can also be used to do things such as creating dust. Called on active tiles. See also ModWorld.PostDrawTiles.
i | |
j | |
type | |
spriteBatch |
Definition at line 249 of file GlobalTile.cs.
|
virtual |
Allows you to draw things behind the tile at the given coordinates. Return false to stop the game from drawing the tile normally. Returns true by default.
i | |
j | |
type | |
spriteBatch |
Definition at line 226 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type |
Definition at line 348 of file GlobalTile.cs.
|
virtual |
Called for every tile the world randomly decides to update in a given tick. Useful for things such as growing or spreading.
i | |
j | |
type |
Definition at line 266 of file GlobalTile.cs.
|
virtual |
Allows you to make something happen when any tile is right-clicked by the player.
i | |
j | |
type |
Definition at line 308 of file GlobalTile.cs.
|
virtual |
Allows a tile to support a sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns -1 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0.
type | |
style |
Definition at line 394 of file GlobalTile.cs.
|
virtual |
Allows you to modify the properties of any tile in the game. Most properties are stored as arrays throughout the Terraria code.
Definition at line 77 of file GlobalTile.cs.
|
virtual |
Allows you to determine whether or not a tile will draw itself flipped in the world.
i | |
j | |
type | |
spriteEffects |
Definition at line 209 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type |
Definition at line 368 of file GlobalTile.cs.
|
virtual |
Special Draw. Only called if coordinates are placed in Main.specX/Y during DrawEffects. Useful for drawing things that would otherwise be impossible to draw due to draw order, such as items in item frames.
i | The i. |
j | The j. |
Definition at line 257 of file GlobalTile.cs.
|
virtual |
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.
i | |
j | |
type | |
resetFrame | |
noBreak |
Definition at line 278 of file GlobalTile.cs.
|
getset |
The mod to which this GlobalTile belongs to.
Definition at line 15 of file GlobalTile.cs.
Referenced by Terraria.ModLoader.GlobalTile.Autoload().
|
getset |
The name of this GlobalTile instance.
Definition at line 23 of file GlobalTile.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalTile().