Exemplo n.º 1
0
        private void PathReached(IPosition position)
        {
            LookAtSide(position);
            IStopToken token = null;

            token = player.tickManager.RegisterReocurring(3, () => {
                if (this.token.stopped)
                {
                    token.Stop();
                    return;
                }

                inventory.Select(SAND.Select(x => (ushort)x).ToArray()); // Scuffed.
                actions.BlockPlaceOnBlockFace(neighbour.location, neighbour.face);

                if (mode == Mode.Fast)
                {
                    if (targets == null || targets.Length == 0)
                    {
                        targets = FindSurroundingTargets();
                    }
                    int placed = 0;
                    if (targets != null && targets.Length != 0)
                    {
                        for (int i = 0; i < this.targets.Length; i++)
                        {
                            if (this.targets[i].Compare(this.target))
                            {
                                continue;
                            }
                            if (placed > 4)
                            {
                                break;
                            }

                            var tneighbour = player.functions.FindValidNeighbour(this.targets[i]);
                            if (tneighbour != null)
                            {
                                actions.BlockPlaceOnBlockFace(tneighbour.location, tneighbour.face);
                                placed++;
                            }
                        }
                    }
                }

                if (IsRowDone())
                {
                    token.Stop();
                    this.ClearTarget();
                    busy = false;
                }
            });
        }
Exemplo n.º 2
0
 private void EventsOnOnPlayerUpdate(IStopToken cancel)
 {
     cancel.Stop();
 }