1using Microsoft.Xna.Framework;
2using Microsoft.Xna.Framework.Graphics;
34 Array.Resize(ref array, array.Length + 1);
35 array[array.Length - 1] = type;
70 public virtual bool Autoload(ref
string name) {
87 public virtual bool KillSound(
int i,
int j,
int type) {
99 public virtual void NumDust(
int i,
int j,
int type,
bool fail, ref
int num) {
110 public virtual bool CreateDust(
int i,
int j,
int type, ref
int dustType) {
123 public virtual void DropCritterChance(
int i,
int j,
int type, ref
int wormChance, ref
int grassHopperChance, ref
int jungleGrubChance) {
129 public virtual bool Drop(
int i,
int j,
int type) {
141 public virtual bool CanKillTile(
int i,
int j,
int type, ref
bool blockDamaged) {
154 public virtual void KillTile(
int i,
int j,
int type, ref
bool fail, ref
bool effectOnly, ref
bool noItem) {
187 public virtual void ModifyLight(
int i,
int j,
int type, ref
float r, ref
float g, ref
float b) {
198 public virtual bool Dangersense(
int i,
int j,
int type, Player player) {
209 public virtual void SetSpriteEffects(
int i,
int j,
int type, ref SpriteEffects spriteEffects) {
226 public virtual bool PreDraw(
int i,
int j,
int type, SpriteBatch spriteBatch) {
239 public virtual void DrawEffects(
int i,
int j,
int type, SpriteBatch spriteBatch, ref Color drawColor, ref
int nextSpecialDrawIndex) {
249 public virtual void PostDraw(
int i,
int j,
int type, SpriteBatch spriteBatch) {
257 public virtual void SpecialDraw(
int i,
int j,
int type, SpriteBatch spriteBatch) {
278 public virtual bool TileFrame(
int i,
int j,
int type, ref
bool resetFrame, ref
bool noBreak) {
289 public virtual bool CanPlace(
int i,
int j,
int type) {
337 public virtual bool AutoSelect(
int i,
int j,
int type, Item item) {
358 public virtual void HitWire(
int i,
int j,
int type) {
368 public virtual bool Slope(
int i,
int j,
int type) {
This class allows you to modify the behavior of any tile in the game. Create an instance of an overri...
void AddModPalmTree(int soilType, ModPalmTree palmTree)
Allows the given type of tile to grow the given modded palm tree.
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....
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....
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...
virtual void HitWire(int i, int j, int type)
Allows you to make something happen when a wire current passes through any tile.
void AddModCactus(int soilType, ModCactus cactus)
Allows the given type of tile to grow the given modded cactus.
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.
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 w...
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....
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.
void AddModTree(int soilType, ModTree tree)
Allows the given type of tile to grow the given modded tree.
virtual void FloorVisuals(int type, Player player)
Allows you to make something happen when a player stands on the given type of tile....
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 fro...
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 ...
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 icon...
virtual void ChangeWaterfallStyle(int type, ref int style)
Allows you to change the style of waterfall that passes through or over any tile.
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 sa...
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....
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 p...
virtual void AnimateTile()
Allows animating tiles that were previously static. Loading a new texture for the tile is required fi...
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 hi...
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....
Mod mod
The mod to which this GlobalTile belongs to.
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...
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...
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 ...
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....
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....
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 shou...
virtual bool Autoload(ref string name)
Allows you to automatically load a GlobalTile instead of using Mod.AddGlobalTile. Return true to allo...
virtual void SetDefaults()
Allows you to modify the properties of any tile in the game. Most properties are stored as arrays thr...
virtual int[] AdjTiles(int type)
Allows you to determine which tiles the given tile type can be considered as when looking for craftin...
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....
string Name
The name of this GlobalTile instance.
virtual void RightClick(int i, int j, int type)
Allows you to make something happen when any tile is right-clicked by the player.
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.
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 ...
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...
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 t...
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...
This class represents a type of modded cactus. The cactus will share a tile ID with the vanilla cacti...
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
This class represents a type of modded palm tree. The palm tree will share a tile ID with the vanilla...
This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5)...
This serves as the central class from which tile-related functions are supported and carried out.
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...