public override void PlaceInWorld(int i, int j, Item item) { base.PlaceInWorld(i, j, item); item.placeStyle %= 4; var tile = Framing.GetTileSafely(i, j); //Sanity check; TileObjectData should already handle this tile.frameX = (short)(item.placeStyle * 18); NetworkCollection.OnItemPipePlace(new Point16(i, j)); }
public override void PlaceInWorld(int i, int j, Item item) { base.PlaceInWorld(i, j, item); NetworkCollection.OnItemPipePlace(new Point16(i, j)); }
public override void PlaceInWorld(int i, int j, Item item) { //(Continuing from CanPlace)... then I can just set it back to false here TechMod.Instance.ResetNetworkTilesSolid(); var tile = Framing.GetTileSafely(i, j); //Sanity check; TileObjectData should already handle this tile.frameX = (short)(item.placeStyle * 18); //Do each axis separately var merge = JunctionMergeable.mergeTypes[tile.frameX / 18]; if ((merge & JunctionMerge.Wires_All) != 0) { if ((merge & JunctionMerge.Wires_UpDown) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Wires_UpDown) * 18); NetworkCollection.OnWirePlace(new Point16(i, j)); } if ((merge & JunctionMerge.Wires_LeftRight) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Wires_LeftRight) * 18); NetworkCollection.OnWirePlace(new Point16(i, j)); } } if ((merge & JunctionMerge.Items_All) != 0) { if ((merge & JunctionMerge.Items_UpDown) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Items_UpDown) * 18); NetworkCollection.OnItemPipePlace(new Point16(i, j)); } if ((merge & JunctionMerge.Items_LeftRight) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Items_LeftRight) * 18); NetworkCollection.OnItemPipePlace(new Point16(i, j)); } } if ((merge & JunctionMerge.Fluids_All) != 0) { if ((merge & JunctionMerge.Fluids_UpDown) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Fluids_UpDown) * 18); NetworkCollection.OnFluidPipePlace(new Point16(i, j)); } if ((merge & JunctionMerge.Fluids_LeftRight) != 0) { tile.frameX = (short)(JunctionMergeable.FindMergeIndex(JunctionMerge.Fluids_LeftRight) * 18); NetworkCollection.OnFluidPipePlace(new Point16(i, j)); } } //Make sure the tile uses the right thing tile.frameX = (short)(item.placeStyle * 18); }