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

◆ PlaceObject()

static bool Terraria.WorldGen.PlaceObject ( int x,
int y,
int type,
bool mute = false,
int style = 0,
int alternate = 0,
int random = -1,
int direction = -1 )
inlinestatic

Definition at line 42995 of file WorldGen.cs.

42996 {
42997 if (type >= TileID.Count)
42998 {
42999 return false;
43000 }
43001 if (!TileObject.CanPlace(x, y, type, style, direction, out var objectData))
43002 {
43003 return false;
43004 }
43005 objectData.random = random;
43006 if (TileObject.Place(objectData))
43007 {
43008 SquareTileFrame(x, y);
43009 if (!mute)
43010 {
43011 SoundEngine.PlaySound(0, x * 16, y * 16);
43012 }
43013 }
43014 return true;
43015 }
static void PlaySound(int type, Vector2 position, int style=1)
static readonly ushort Count
Definition TileID.cs:1698
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.TileObject.CanPlace(), Terraria.ID.TileID.Count, Terraria.TileObject.Place(), Terraria.Audio.SoundEngine.PlaySound(), and System.type.

Referenced by Terraria.MessageBuffer.GetData().