/// <summary> /// Adds an item to the specified map location. /// </summary> public static void AddItem(Item item, Point2D mapLocation, int dimension) { Point2D chunkLocation = WorldUtil.CalculateChunkLocation(mapLocation); Chunk chunk = World.Data.World.Dimensions[dimension].GetChunk(chunkLocation.X, chunkLocation.Y); ItemAdder.RememberWhichChunk(chunkLocation, item.ItemID, dimension); ItemAdder.RememberWhichTile(item, mapLocation, chunk, dimension); ItemAdder.StoreItem(chunk, mapLocation, item); }
/// <summary> /// Adds an item during the ongoing world generation. /// </summary> public static void AddItemWorldGen(Item item, Point2D mapLocation, ProtoArray <Chunk> map, int dimension) { Point2D chunkLocation = WorldUtil.CalculateChunkLocation(mapLocation); Chunk chunk = map[chunkLocation.X, chunkLocation.Y]; ItemAdder.RememberWhichChunk(chunkLocation, item.ItemID, dimension); ItemAdder.RememberWhichTile(item, mapLocation, chunk, dimension); ItemAdder.StoreItem(chunk, mapLocation, item); }
/// <summary> /// Adds an item to the specified map location. /// </summary> public static void AddItem(Item item, Point2D mapLocation, int dimension) { if (World.Data.World.Mode != Networking.EngineMode.ServerOnly) { NetworkAdd(item, mapLocation, dimension); } Point2D chunkLocation = WorldUtil.CalculateChunkLocation(mapLocation); Chunk chunk = World.Data.World.Dimensions[dimension].GetChunk(chunkLocation.X, chunkLocation.Y); ItemAdder.RememberWhichChunk(chunkLocation, item.ItemID, dimension); ItemAdder.RememberWhichTile(item, mapLocation, chunk); ItemAdder.StoreItem(chunk, mapLocation, item); }