示例#1
0
        private void OnUpset(Vec3i voxelPos, BlockFacing towardsFace)
        {
            if (AvailableVoxels <= 0)
            {
                return;
            }
            Vec3i npos = voxelPos.Add(towardsFace);

            if (npos.X >= 0 && npos.X < 16 && npos.Y >= 0 && npos.Y < 16 && npos.Z >= 0 && npos.Z < 16 && !Voxels[npos.X, npos.Y, npos.Z])
            {
                Voxels[npos.X, npos.Y, npos.Z] = true;
                AvailableVoxels--;
            }
        }
示例#2
0
        public override void OnInteractStart(WorldEdit worldEdit, BlockSelection blockSelection)
        {
            if (blockSelection == null)
            {
                return;
            }

            BlockPos center = (workspace.StartMarker + workspace.EndMarker) / 2;

            center.Y = Math.Min(workspace.StartMarker.Y, workspace.EndMarker.Y);

            Vec3i offset = (blockSelection.Position - center).ToVec3i();

            offset.Add(blockSelection.Face);

            Handle(worldEdit, offset);
        }