TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ CanReplace()

virtual bool Terraria.ModLoader.ModTile.CanReplace ( int i,
int j,
int tileTypeBeingPlaced )
inlinevirtualinherited

Allows you to stop this 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.
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. F:Terraria.ID.TileID.Sets.DoesntGetReplacedWithTileReplacement, F:Terraria.ID.TileID.Sets.DoesntPlaceWithTileReplacement, and F:Terraria.ID.TileID.Sets.PreventsTileReplaceIfOnTopOfIt cover the most common use cases and should be used instead if possible.

Parameters
i
j
tileTypeBeingPlaced
Returns

Definition at line 612 of file ModTile.cs.

613 {
614 return true;
615 }